[Pkg-shadow-commits] r2111 - in upstream/trunk: . lib
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Tue Jun 10 20:01:56 UTC 2008
Author: nekral-guest
Date: 2008-06-10 20:01:55 +0000 (Tue, 10 Jun 2008)
New Revision: 2111
Modified:
upstream/trunk/ChangeLog
upstream/trunk/lib/nscd.c
Log:
* lib/nscd.c: Include defines.h.
* lib/nscd.c: Always warn when the nscd cache cannot be flushed.
* lib/nscd.c: Avoid assignments in comparisons.
* lib/nscd.c: Ignore the return value of fputs() when printing
errors.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-06-10 19:59:26 UTC (rev 2110)
+++ upstream/trunk/ChangeLog 2008-06-10 20:01:55 UTC (rev 2111)
@@ -1,5 +1,13 @@
2008-06-10 Nicolas François <nicolas.francois at centraliens.net>
+ * lib/nscd.c: Include defines.h.
+ * lib/nscd.c: Always warn when the nscd cache cannot be flushed.
+ * lib/nscd.c: Avoid assignments in comparisons.
+ * lib/nscd.c: Ignore the return value of fputs() when printing
+ errors.
+
+2008-06-10 Nicolas François <nicolas.francois at centraliens.net>
+
* lib/port.c: Add brackets and parenthesis.
* lib/port.c: Change isttytime() prototype to return a bool.
* lib/port.c: Ignore the return value of fclose () (file open
Modified: upstream/trunk/lib/nscd.c
===================================================================
--- upstream/trunk/lib/nscd.c 2008-06-10 19:59:26 UTC (rev 2110)
+++ upstream/trunk/lib/nscd.c 2008-06-10 20:01:55 UTC (rev 2111)
@@ -11,8 +11,11 @@
#include <errno.h>
#include <sys/wait.h>
#include <sys/types.h>
+#include "defines.h"
#include "nscd.h"
+#define MSG_NSCD_FLUSH_CACHE_FAILED "Failed to flush the nscd cache.\n"
+
/*
* nscd_flush_cache - flush specified service buffer in nscd cache
*/
@@ -24,24 +27,28 @@
char *spawnedEnv[] = {NULL};
/* spawn process */
- if( (err=posix_spawn(&pid, spawnedArgs[0], NULL, NULL,
- spawnedArgs, spawnedEnv)) !=0 )
+ err = posix_spawn(&pid, spawnedArgs[0], NULL, NULL,
+ spawnedArgs, spawnedEnv);
+ if(0 != err)
{
- fprintf(stderr, "posix_spawn() error=%d\n", err);
+ (void) fputs (_(MSG_NSCD_FLUSH_CACHE_FAILED), stderr);
+ (void) fprintf (stderr, "posix_spawn() error=%d\n", err);
return -1;
}
- /* Wait for the spawned process to exit */
+ /* Wait for the spawned process to exit */
termpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0));
- if (termpid == -1)
+ if (-1 == termpid)
{
+ (void) fputs (_(MSG_NSCD_FLUSH_CACHE_FAILED), stderr);
perror("waitpid");
return -1;
}
else if (termpid != pid)
{
- fprintf(stderr, "waitpid returned %ld != %ld\n",
- (long int) termpid, (long int) pid);
+ (void) fputs (_(MSG_NSCD_FLUSH_CACHE_FAILED), stderr);
+ (void) fprintf (stderr, "waitpid returned %ld != %ld\n",
+ (long int) termpid, (long int) pid);
return -1;
}
More information about the Pkg-shadow-commits
mailing list