mirror of
https://repo.or.cz/socat.git
synced 2025-07-15 23:53:25 +00:00
Socat lock files generated with -L and -W now have mode 644
This commit is contained in:
parent
3678757fed
commit
4565c8e6ac
2 changed files with 7 additions and 2 deletions
|
@ -51,14 +51,14 @@ int xiogetlock(const char *lockfile) {
|
|||
}
|
||||
|
||||
pid = Getpid();
|
||||
bytes = sprintf(pidbuf, F_pid, pid);
|
||||
bytes = sprintf(pidbuf, F_pid"\n", pid);
|
||||
if (writefull(fd, pidbuf, bytes) < 0) {
|
||||
Error4("write(%d, %p, "F_Zu"): %s", fd, pidbuf, bytes, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
Fchmod(fd, 0644);
|
||||
Close(fd);
|
||||
|
||||
/* Chmod(lockfile, 0600); */
|
||||
if (Link(s, lockfile) < 0) {
|
||||
int _errno = errno;
|
||||
Error3("link(\"%s\", \"%s\"): %s", s, lockfile, strerror(errno));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue