summaryrefslogtreecommitdiffstats
path: root/login-utils/chsh.c
diff options
context:
space:
mode:
authorSami Kerola2011-11-13 17:36:55 +0100
committerSami Kerola2011-11-23 21:50:17 +0100
commit8187b555df56bdb8bcc63ce8fb39e99564408e62 (patch)
tree064a28c15c1fc2c3e79556f88ccac62956d605cb /login-utils/chsh.c
parentlogin: add version printing option (diff)
downloadkernel-qcow2-util-linux-8187b555df56bdb8bcc63ce8fb39e99564408e62.tar.gz
kernel-qcow2-util-linux-8187b555df56bdb8bcc63ce8fb39e99564408e62.tar.xz
kernel-qcow2-util-linux-8187b555df56bdb8bcc63ce8fb39e99564408e62.zip
chfn, chsh, setpwnam: get true/false from stdbool.h
Requires C99, which should not be a problem. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/chsh.c')
-rw-r--r--login-utils/chsh.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index f84baba54..043022ee6 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -31,6 +31,7 @@
#include <errno.h>
#include <ctype.h>
#include <getopt.h>
+#include <stdbool.h>
#include "c.h"
#include "islocal.h"
@@ -61,10 +62,6 @@
#include "selinux_utils.h"
#endif
-typedef unsigned char boolean;
-#define false 0
-#define true 1
-
/* Only root is allowed to assign a luser a non-listed shell, by default */
#define ONLY_LISTED_SHELLS 1
@@ -76,7 +73,7 @@ struct sinfo {
static void parse_argv (int argc, char *argv[], struct sinfo *pinfo);
static char *prompt (char *question, char *def_val);
static int check_shell (char *shell);
-static boolean get_shell_list (char *shell);
+static int get_shell_list (char *shell);
static void __attribute__((__noreturn__)) usage (FILE *fp)
{
@@ -345,10 +342,10 @@ check_shell (char *shell) {
* return true. if not, return false.
* if the given shell is NULL, /etc/shells is outputted to stdout.
*/
-static boolean
+static int
get_shell_list (char *shell_name) {
FILE *fp;
- boolean found;
+ int found;
int len;
char buf[PATH_MAX];