Lines Matching refs:o

13         Operation *o = userdata;  in operation_done()  local
16 assert(o); in operation_done()
20 o->pid, in operation_done()
23 o->pid = 0; in operation_done()
32 …else if (read(o->errno_fd, &r, sizeof(r)) != sizeof(r)) { /* Try to acquire error code for failed … in operation_done()
37 if (o->done) { in operation_done()
39 r = o->done(o, r, &error); in operation_done()
55 r = sd_bus_reply_method_return(o->message, NULL); in operation_done()
60 operation_free(o); in operation_done()
64 r = sd_bus_reply_method_error(o->message, &error); in operation_done()
68 operation_free(o); in operation_done()
73 Operation *o; in operation_new() local
81 o = new0(Operation, 1); in operation_new()
82 if (!o) in operation_new()
85 o->extra_fd = -1; in operation_new()
87 r = sd_event_add_child(manager->event, &o->event_source, child, WEXITED, operation_done, o); in operation_new()
89 free(o); in operation_new()
93 o->pid = child; in operation_new()
94 o->message = sd_bus_message_ref(message); in operation_new()
95 o->errno_fd = errno_fd; in operation_new()
97 LIST_PREPEND(operations, manager->operations, o); in operation_new()
99 o->manager = manager; in operation_new()
102 LIST_PREPEND(operations_by_machine, machine->operations, o); in operation_new()
103 o->machine = machine; in operation_new()
111 *ret = o; in operation_new()
116 Operation *operation_free(Operation *o) { in operation_free() argument
117 if (!o) in operation_free()
120 sd_event_source_unref(o->event_source); in operation_free()
122 safe_close(o->errno_fd); in operation_free()
123 safe_close(o->extra_fd); in operation_free()
125 if (o->pid > 1) in operation_free()
126 (void) sigkill_wait(o->pid); in operation_free()
128 sd_bus_message_unref(o->message); in operation_free()
130 if (o->manager) { in operation_free()
131 LIST_REMOVE(operations, o->manager->operations, o); in operation_free()
132 o->manager->n_operations--; in operation_free()
135 if (o->machine) in operation_free()
136 LIST_REMOVE(operations_by_machine, o->machine->operations, o); in operation_free()
138 return mfree(o); in operation_free()