* lib/commonio.h: commonio_entry.changed, commonio_db.changed, commonio_db.isopen, commonio_db.locked, and commonio_db.readonly are no booleans.

* lib/commonio.h: Include defines.h to get the definition of bool.
	* lib/commonio.h: commonio_present returns a bool
	* lib/commonio.c: Implement above changes.
	* lib/commonio.c: add argument names in prototypes.
	* lib/commonio.c: name_is_nis returns a bool.
	* lib/commonio.c: nscd_need_reload is a bool.
	* lib/commonio.c: Improve types (use size_t / pid_t when needed instead of int).
	* lib/commonio.c: Avoid assignments in comparisons.
	* lib/commonio.c: Add brackets and parenthesis.
	* lib/commonio.c: Avoid implicit conversion of pointers / integers to booleans
	* lib/commonio.c: The return values of utime is not checked on purpose.
This commit is contained in:
nekral-guest
2008-05-26 00:46:25 +00:00
parent a24aff2148
commit f16c6bd7dd
3 changed files with 204 additions and 124 deletions

View File

@@ -37,6 +37,9 @@
#ifdef WITH_SELINUX
#include <selinux/selinux.h>
#endif
#include "defines.h"
/*
* Linked list entry.
*/
@@ -44,7 +47,7 @@ struct commonio_entry {
char *line;
void *eptr; /* struct passwd, struct spwd, ... */
struct commonio_entry *prev, *next;
unsigned int changed:1;
bool changed:1;
};
/*
@@ -127,14 +130,14 @@ struct commonio_db {
/*
* Various flags.
*/
unsigned int changed:1;
unsigned int isopen:1;
unsigned int locked:1;
unsigned int readonly:1;
bool changed:1;
bool isopen:1;
bool locked:1;
bool readonly:1;
};
extern int commonio_setname (struct commonio_db *, const char *);
extern int commonio_present (const struct commonio_db *);
extern bool commonio_present (const struct commonio_db *db);
extern int commonio_lock (struct commonio_db *);
extern int commonio_lock_nowait (struct commonio_db *);
extern int commonio_open (struct commonio_db *, int);