[Pkg-shadow-commits] r3106 - in upstream/trunk: . lib
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Thu Mar 11 22:04:15 UTC 2010
Author: nekral-guest
Date: 2010-03-11 22:04:14 +0000 (Thu, 11 Mar 2010)
New Revision: 3106
Modified:
upstream/trunk/ChangeLog
upstream/trunk/lib/commonio.c
Log:
* lib/commonio.c: Re-indent.
* lib/commonio.c: Document the sections closed by #endif
* lib/commonio.c: Added brackets.
* lib/commonio.c: Avoid implicit conversion of integer to
booleans.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2010-03-11 22:04:06 UTC (rev 3105)
+++ upstream/trunk/ChangeLog 2010-03-11 22:04:14 UTC (rev 3106)
@@ -1,5 +1,13 @@
2010-03-11 Nicolas François <nicolas.francois at centraliens.net>
+ * lib/commonio.c: Re-indent.
+ * lib/commonio.c: Document the sections closed by #endif
+ * lib/commonio.c: Added brackets.
+ * lib/commonio.c: Avoid implicit conversion of integer to
+ booleans.
+
+2010-03-11 Nicolas François <nicolas.francois at centraliens.net>
+
* src/userdel.c: Re-indent.
* src/userdel.c: Added brackets.
* src/userdel.c: Avoid implicit conversion of pointers to
Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c 2010-03-11 22:04:06 UTC (rev 3105)
+++ upstream/trunk/lib/commonio.c 2010-03-11 22:04:14 UTC (rev 3106)
@@ -47,10 +47,10 @@
#include "nscd.h"
#ifdef WITH_SELINUX
#include <selinux/selinux.h>
-#endif
+#endif /* WITH_SELINUX */
#ifdef WITH_TCB
#include <tcb.h>
-#endif
+#endif /* WITH_TCB */
#include "prototypes.h"
#include "commonio.h"
@@ -222,21 +222,21 @@
if (fchown (fileno (fp), sb->st_uid, sb->st_gid) != 0) {
goto fail;
}
-#else
+#else /* !HAVE_FCHOWN */
if (chown (name, sb->st_mode) != 0) {
goto fail;
}
-#endif
+#endif /* !HAVE_FCHOWN */
#ifdef HAVE_FCHMOD
if (fchmod (fileno (fp), sb->st_mode & 0664) != 0) {
goto fail;
}
-#else
+#else /* !HAVE_FCHMOD */
if (chmod (name, sb->st_mode & 0664) != 0) {
goto fail;
}
-#endif
+#endif /* !HAVE_FCHMOD */
return fp;
fail:
@@ -374,7 +374,7 @@
ulckpwdf ();
return 0; /* failure */
-#else
+#else /* !HAVE_LCKPWDF */
int i;
/*
@@ -400,7 +400,7 @@
}
}
return 0; /* failure */
-#endif
+#endif /* !HAVE_LCKPWDF */
}
static void dec_lock_count (void)
@@ -417,7 +417,7 @@
}
#ifdef HAVE_LCKPWDF
ulckpwdf ();
-#endif
+#endif /* HAVE_LCKPWDF */
}
}
}
@@ -557,22 +557,24 @@
db->cursor = NULL;
db->changed = false;
- fd = open(db->filename, (db->readonly ? O_RDONLY : O_RDWR) |
- O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
+ fd = open (db->filename,
+ (db->readonly ? O_RDONLY : O_RDWR)
+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
saved_errno = errno;
db->fp = NULL;
if (fd >= 0) {
#ifdef WITH_TCB
- if (tcb_is_suspect(fd)) {
- close(fd);
+ if (tcb_is_suspect (fd) != 0) {
+ close (fd);
errno = EINVAL;
return 0;
}
-#endif
- db->fp = fdopen(fd, db->readonly ? "r" : "r+");
+#endif /* WITH_TCB */
+ db->fp = fdopen (fd, db->readonly ? "r" : "r+");
saved_errno = errno;
- if (!db->fp)
- close(fd);
+ if (!db->fp) {
+ close (fd);
+ }
}
errno = saved_errno;
@@ -589,7 +591,7 @@
}
/* Do not inherit fd in spawned processes (e.g. nscd) */
- fcntl(fileno(db->fp), F_SETFD, FD_CLOEXEC);
+ fcntl (fileno (db->fp), F_SETFD, FD_CLOEXEC);
#ifdef WITH_SELINUX
db->scontext = NULL;
@@ -598,7 +600,7 @@
goto cleanup_errno;
}
}
-#endif
+#endif /* WITH_SELINUX */
buflen = BUFLEN;
buf = (char *) malloc (buflen);
@@ -689,7 +691,7 @@
freecon (db->scontext);
db->scontext = NULL;
}
-#endif
+#endif /* WITH_SELINUX */
fclose (db->fp);
db->fp = NULL;
errno = saved_errno;
@@ -837,7 +839,7 @@
#ifdef WITH_SELINUX
/*@null@*/security_context_t old_context = NULL;
-#endif
+#endif /* WITH_SELINUX */
if (!db->isopen) {
errno = EINVAL;
@@ -873,7 +875,7 @@
goto fail;
}
}
-#endif
+#endif /* WITH_SELINUX */
/*
* Create backup file.
*/
@@ -919,9 +921,9 @@
if (fsync (fileno (db->fp)) != 0) {
errors++;
}
-#else
+#else /* !HAVE_FSYNC */
sync ();
-#endif
+#endif /* !HAVE_FSYNC */
if (fclose (db->fp) != 0) {
errors++;
}
@@ -955,7 +957,7 @@
freecon (db->scontext);
db->scontext = NULL;
}
-#endif
+#endif /* WITH_SELINUX */
free_linked_list (db);
return errors == 0;
}
@@ -986,7 +988,7 @@
struct commonio_db *db,
const char *name)
{
- return next_entry_by_name(db, db->head, name);
+ return next_entry_by_name (db, db->head, name);
}
@@ -1032,9 +1034,9 @@
#if KEEP_NIS_AT_END
add_one_entry_nis (db, p);
-#else
+#else /* !KEEP_NIS_AT_END */
add_one_entry (db, p);
-#endif
+#endif /* !KEEP_NIS_AT_END */
db->changed = true;
return 1;
More information about the Pkg-shadow-commits
mailing list