#ifndef lint
-static char sccsid[] = "@(#)cmds.c 4.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmds.c 4.5 (Berkeley) %G%";
#endif
/*
return;
}
if (!getline(fp) || flock(fileno(fp), LOCK_SH|LOCK_NB) == 0) {
- (void) fclose(fp);
+ (void) fclose(fp); /* unlocks as well */
printf("\tno daemon to abort\n");
return;
}
printf("\t%d entries in spool area\n", i);
fd = open(line, O_RDONLY);
if (fd < 0 || flock(fd, LOCK_SH|LOCK_NB) == 0) {
- (void) close(fd);
+ (void) close(fd); /* unlocks as well */
printf("\tno daemon present\n");
return;
}
(void) flock(fd, LOCK_SH);
while ((i = read(fd, line, sizeof(line))) > 0)
(void) fwrite(line, 1, i, stdout);
- (void) close(fd);
+ (void) close(fd); /* unlocks as well */
}
}