hush: initial stab at brace expansion support
[oweals/busybox.git] / miscutils / crontab.c
index 902014963dc951054a12068aad84fee0af3de217..67b10f684180fd16516e6237cb5e08af3705644e 100644 (file)
@@ -12,9 +12,7 @@
 
 #include "libbb.h"
 
-#ifndef CRONTABS
-#define CRONTABS        "/var/spool/cron/crontabs"
-#endif
+#define CRONTABS        CONFIG_FEATURE_CROND_DIR "/crontabs"
 #ifndef CRONUPDATE
 #define CRONUPDATE      "cron.update"
 #endif
@@ -126,9 +124,7 @@ int crontab_main(int argc UNUSED_PARAM, char **argv)
        }
 
        if (opt_ler & OPT_u) {
-               pas = getpwnam(user_name);
-               if (!pas)
-                       bb_error_msg_and_die("user %s is not known", user_name);
+               pas = xgetpwnam(user_name);
        } else {
                pas = xgetpwuid(getuid());
        }
@@ -197,7 +193,7 @@ int crontab_main(int argc UNUSED_PARAM, char **argv)
                        close(fd);
                        xrename(new_fname, pas->pw_name);
                } else {
-                       bb_error_msg("cannot create %s/%s",
+                       bb_error_msg("can't create %s/%s",
                                        crontab_dir, new_fname);
                }
                if (tmp_fname)
@@ -224,7 +220,7 @@ int crontab_main(int argc UNUSED_PARAM, char **argv)
                /* loop */
        }
        if (fd < 0) {
-               bb_error_msg("cannot append to %s/%s",
+               bb_error_msg("can't append to %s/%s",
                                crontab_dir, CRONUPDATE);
        }
        return 0;