]> err.no Git - systemd/commitdiff
manager: properly return newly created job in transaction_add_job_and_dependencies()
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Feb 2010 01:21:08 +0000 (02:21 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 12 Feb 2010 01:21:08 +0000 (02:21 +0100)
manager.c
test1/syslog.socket

index 7a31c0c9d2809f2f7edf93a6952ae5524bb33997..ace480c4dd5f0185a6d22ec2386bd2f7a7483d00 100644 (file)
--- a/manager.c
+++ b/manager.c
@@ -901,6 +901,9 @@ static int transaction_add_job_and_dependencies(Manager *m, JobType type, Unit *
                 /* JOB_VERIFY_STARTED, JOB_RELOAD require no dependency handling */
         }
 
+        if (_ret)
+                *_ret = ret;
+
         return 0;
 
 fail:
@@ -918,7 +921,7 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool for
 
         log_debug("Trying to enqueue job %s/%s", unit_id(unit), job_type_to_string(type));
 
-        if ((r = transaction_add_job_and_dependencies(m, type, unit, NULL, true, force, &ret))) {
+        if ((r = transaction_add_job_and_dependencies(m, type, unit, NULL, true, force, &ret)) < 0) {
                 transaction_abort(m);
                 return r;
         }
@@ -926,7 +929,7 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool for
         if ((r = transaction_activate(m, mode)) < 0)
                 return r;
 
-        log_debug("Enqueued job %s/%s", unit_id(unit), job_type_to_string(type));
+        log_debug("Enqueued job %s/%s as %u", unit_id(unit), job_type_to_string(type), (unsigned) ret->id);
 
         if (_ret)
                 *_ret = ret;
index 524da506137948d49425db39cb78c5a058737a9e..f2d3297acd1feaa621f5891d9748035773ddf89c 100644 (file)
@@ -5,4 +5,4 @@ Description=Syslog Socket
 ListenDatagram=/tmp/foobar/waldo/systemd-syslog-socket
 ListenStream=eth0:3456
 DirectoryMode=0700
-SocketMode=0400
+SocketMode=0600