+2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
+
+ * libmisc/utmp.c (checkutmp): Change picky argument's type to
+ bool.
+ * libmisc/utmp.c: Use bool when possible (found_utmpx,
+ found_utmp).
+ * libmisc/utmp.c: Add note about unchecked return values.
+
2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/addgrps.c: Change type of added to bool.
#elif defined(LOGIN_PROCESS)
-void checkutmp (int picky)
+void checkutmp (bool picky)
{
char *line;
struct utmp *ut;
struct utmp *utmp, utline;
struct utmpx *utmpx, utxline;
pid_t pid = getpid ();
- int found_utmpx = 0, found_utmp = 0;
+ bool found_utmpx = false, found_utmp = false;
/*
* The canonical device name doesn't include "/dev/"; skip it
while (utmpx = getutxent ()) {
if (utmpx->ut_pid == pid) {
- found_utmpx = 1;
+ found_utmpx = true;
break;
}
}
while (utmp = getutent ()) {
if (utmp->ut_pid == pid) {
- found_utmp = 1;
+ found_utmp = true;
break;
}
}
pututxline (&utxline);
pututline (&utline);
+ /* TODO: log failures */
updwtmpx (_WTMP_FILE "x", &utxline);
updwtmp (_WTMP_FILE, &utline);