=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/Attic/dotlock.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/mail/Attic/dotlock.c 1997/07/13 21:21:11 1.2 --- src/usr.bin/mail/Attic/dotlock.c 1997/07/13 23:53:59 1.3 *************** *** 1,4 **** ! /* $OpenBSD: dotlock.c,v 1.2 1997/07/13 21:21:11 millert Exp $ */ /* $NetBSD: dotlock.c,v 1.1 1996/06/08 19:48:19 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: dotlock.c,v 1.3 1997/07/13 23:53:59 millert Exp $ */ /* $NetBSD: dotlock.c,v 1.1 1996/06/08 19:48:19 christos Exp $ */ /* *************** *** 31,37 **** */ #ifndef lint ! static char rcsid[] = "$OpenBSD: dotlock.c,v 1.2 1997/07/13 21:21:11 millert Exp $"; #endif #include --- 31,37 ---- */ #ifndef lint ! static char rcsid[] = "$OpenBSD: dotlock.c,v 1.3 1997/07/13 23:53:59 millert Exp $"; #endif #include *************** *** 76,83 **** int fd, serrno; struct stat st; ! (void) gettimeofday(&tv, NULL); ! (void) gethostname(hostname, MAXHOSTNAMELEN); pid = getpid(); cookie = pid ^ tv.tv_usec; --- 76,83 ---- int fd, serrno; struct stat st; ! (void)gettimeofday(&tv, NULL); ! (void)gethostname(hostname, MAXHOSTNAMELEN); pid = getpid(); cookie = pid ^ tv.tv_usec; *************** *** 90,96 **** else ptr++; ! (void) snprintf(path, sizeof(path), "%.*s.%s.%x", ptr - fname, fname, hostname, cookie); /* --- 90,96 ---- else ptr++; ! (void)snprintf(path, sizeof(path), "%.*s.%s.%x", ptr - fname, fname, hostname, cookie); /* *************** *** 121,127 **** if (stat(path, &st) == -1) goto bad; ! (void) unlink(path); /* * If the number of links was two (one for the unique file and one --- 121,127 ---- if (stat(path, &st) == -1) goto bad; ! (void)unlink(path); /* * If the number of links was two (one for the unique file and one *************** *** 135,141 **** bad: serrno = errno; ! (void) unlink(path); errno = serrno; return(-1); } --- 135,141 ---- bad: serrno = errno; ! (void)unlink(path); errno = serrno; return(-1); } *************** *** 160,181 **** sigaddset(&nset, SIGTSTP); sigaddset(&nset, SIGCHLD); ! (void) snprintf(path, sizeof(path), "%s.lock", fname); for (;;) { ! (void) sigprocmask(SIG_BLOCK, &nset, &oset); if (create_exclusive(path) != -1) { ! (void) sigprocmask(SIG_SETMASK, &oset, NULL); return(0); } else ! (void) sigprocmask(SIG_SETMASK, &oset, NULL); if (errno != EEXIST) return(-1); if (fp && msg) ! (void) fputs(msg, fp); if (pollinterval) { if (pollinterval == -1) { --- 160,181 ---- sigaddset(&nset, SIGTSTP); sigaddset(&nset, SIGCHLD); ! (void)snprintf(path, sizeof(path), "%s.lock", fname); for (;;) { ! (void)sigprocmask(SIG_BLOCK, &nset, &oset); if (create_exclusive(path) != -1) { ! (void)sigprocmask(SIG_SETMASK, &oset, NULL); return(0); } else ! (void)sigprocmask(SIG_SETMASK, &oset, NULL); if (errno != EEXIST) return(-1); if (fp && msg) ! (void)fputs(msg, fp); if (pollinterval) { if (pollinterval == -1) { *************** *** 193,198 **** { char path[MAXPATHLEN]; ! (void) snprintf(path, sizeof(path), "%s.lock", fname); ! (void) unlink(path); } --- 193,198 ---- { char path[MAXPATHLEN]; ! (void)snprintf(path, sizeof(path), "%s.lock", fname); ! (void)unlink(path); }