diff options
author | 2005-11-28 21:54:06 +0000 | |
---|---|---|
committer | 2005-11-28 21:54:06 +0000 | |
commit | b0d2416bd810fd812e815469542974597408a0d6 (patch) | |
tree | 3a6ba5fc195c6b0e6c303bb835f00b38e091b9dd /lib/libutil/uucplock.c | |
parent | sync (diff) | |
download | wireguard-openbsd-b0d2416bd810fd812e815469542974597408a0d6.tar.xz wireguard-openbsd-b0d2416bd810fd812e815469542974597408a0d6.zip |
spaces, and a off_t typecast to please lint
Diffstat (limited to 'lib/libutil/uucplock.c')
-rw-r--r-- | lib/libutil/uucplock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libutil/uucplock.c b/lib/libutil/uucplock.c index 8842fcccc2c..8f3f3e8858e 100644 --- a/lib/libutil/uucplock.c +++ b/lib/libutil/uucplock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uucplock.c,v 1.13 2005/03/03 00:14:17 cloder Exp $ */ +/* $OpenBSD: uucplock.c,v 1.14 2005/11/28 21:54:06 deraadt Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -78,7 +78,7 @@ uu_lock(const char *ttyname) GORET(0, UU_LOCK_CREAT_ERR); for (i = 0; i < MAXTRIES; i++) { - if (link (lcktmpname, lckname) < 0) { + if (link(lcktmpname, lckname) < 0) { if (errno != EEXIST) GORET(1, UU_LOCK_LINK_ERR); /* @@ -89,7 +89,7 @@ uu_lock(const char *ttyname) if ((fd = open(lckname, O_RDONLY)) < 0) GORET(1, UU_LOCK_OPEN_ERR); - if ((pid_old = get_pid (fd, &err)) == -1) + if ((pid_old = get_pid(fd, &err)) == -1) GORET(2, UU_LOCK_READ_ERR); close(fd); @@ -102,7 +102,7 @@ uu_lock(const char *ttyname) */ (void)unlink(lckname); } else { - if (!put_pid (tmpfd, pid)) + if (!put_pid(tmpfd, pid)) GORET(3, UU_LOCK_WRITE_ERR); break; } @@ -203,7 +203,7 @@ put_pid(int fd, pid_t pid) if (len < sizeof buf && len != -1 && write (fd, buf, len) == len) { /* We don't mind too much if ftruncate() fails - see get_pid */ - ftruncate(fd, len); + ftruncate(fd, (off_t)len); return 1; } return 0; @@ -216,10 +216,10 @@ get_pid(int fd, int *err) char buf[32]; pid_t pid; - bytes_read = read (fd, buf, sizeof (buf) - 1); + bytes_read = read(fd, buf, sizeof (buf) - 1); if (bytes_read > 0) { buf[bytes_read] = '\0'; - pid = strtoul (buf, (char **) NULL, 10); + pid = strtoul(buf, (char **) NULL, 10); } else { pid = -1; *err = bytes_read ? errno : EINVAL; |