diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-06-26 09:27:21 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-06-26 09:27:21 +0000 |
commit | 1338a264d57ad5f74ce6f8283966020a8e978d2e (patch) | |
tree | b14a2a596dd615ae17880b7007d6b2b78191af94 /pid.c | |
parent | 55abb63f11967a147d26e4654cbbd7ab3f01a558 (diff) | |
download | lcd4linux-1338a264d57ad5f74ce6f8283966020a8e978d2e.tar.gz |
[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
Diffstat (limited to 'pid.c')
-rw-r--r-- | pid.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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; |