From 1338a264d57ad5f74ce6f8283966020a8e978d2e Mon Sep 17 00:00:00 2001 From: reinelt Date: Sat, 26 Jun 2004 09:27:21 +0000 Subject: [lcd4linux @ 2004-06-26 09:27:20 by reinelt] added '-W' to CFLAGS changed all C++ comments to C ones ('//' => '/* */') cleaned up a lot of signed/unsigned mistakes git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@480 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- pid.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pid.c') diff --git a/pid.c b/pid.c index 1bb2d5e..50687a1 100644 --- a/pid.c +++ b/pid.c @@ -1,4 +1,4 @@ -/* $Id: pid.c,v 1.6 2004/03/19 06:37:47 reinelt Exp $ +/* $Id: pid.c,v 1.7 2004/06/26 09:27:21 reinelt Exp $ * * PID file handling * @@ -22,6 +22,12 @@ * * * $Log: pid.c,v $ + * Revision 1.7 2004/06/26 09:27:21 reinelt + * + * added '-W' to CFLAGS + * changed all C++ comments to C ones ('//' => '/* */') + * cleaned up a lot of signed/unsigned mistakes + * * Revision 1.6 2004/03/19 06:37:47 reinelt * asynchronous thread handling started * @@ -104,7 +110,8 @@ int pid_init (const char *pidfile) } qprintf(buffer, sizeof(buffer), "%d\n", (int)getpid()); - if (write(fd, buffer, strlen(buffer))!=strlen(buffer)) { + len = strlen(buffer); + if (write(fd, buffer, len) != len) { error ("write(%s) failed: %s", tmpfile, strerror(errno)); close(fd); unlink(tmpfile); @@ -122,7 +129,7 @@ int pid_init (const char *pidfile) } if ((fd=open(pidfile, O_RDONLY))==-1) { - if (errno==ENOENT) continue; // pidfile disappared + if (errno==ENOENT) continue; /* pidfile disappared */ error ("open(%s) failed: %s", pidfile, strerror(errno)); unlink (tmpfile); return -1; -- cgit v1.2.3