]> granicus.if.org Git - cronie/commitdiff
Log failures in load_user().
authorTomas Mraz <tmraz@fedoraproject.org>
Tue, 11 Jun 2013 17:53:59 +0000 (19:53 +0200)
committerTomas Mraz <tmraz@fedoraproject.org>
Tue, 11 Jun 2013 17:53:59 +0000 (19:53 +0200)
src/user.c

index ebe435b6da0d46cfb2a53aa20c65f4b1213c0770..20c0d96b1a9d27097b2e63ac3982d0313d1a091b 100644 (file)
@@ -77,8 +77,10 @@ load_user (int crontab_fd, struct passwd *pw, const char *uname,
        Debug(DPARS, ("load_user()\n"));
        /* file is open.  build user entry, then read the crontab file.
         */
-       if ((u = (user *) malloc (sizeof (user))) == NULL)
+       if ((u = (user *) malloc (sizeof (user))) == NULL) {
+               save_errno = errno;
                goto done;
+       }
        memset(u, 0, sizeof(*u));
 
        if (((u->name = strdup(fname)) == NULL)
@@ -129,6 +131,8 @@ load_user (int crontab_fd, struct passwd *pw, const char *uname,
 
 done:
        if (status == TRUE) {
+               log_it(uname, getpid(), "FAILED", "loading cron table",
+                       save_errno);
                free_user(u);
                u = NULL;
        }