Lines Matching refs:item

45 static struct write_queue_item* write_queue_item_free(struct write_queue_item *item) {  in write_queue_item_free()  argument
46 if (!item) in write_queue_item_free()
49 free(item->file); in write_queue_item_free()
50 return mfree(item); in write_queue_item_free()
193 LIST_FOREACH(queue, item, c->write_queue) in save_state_queue_remove()
194 if ((state_file && streq(item->file, state_file)) || idx == item->rfkill_idx) { in save_state_queue_remove()
195 … log_debug("Canceled previous save state of '%s' to %s.", one_zero(item->state), item->file); in save_state_queue_remove()
196 LIST_REMOVE(queue, c->write_queue, item); in save_state_queue_remove()
197 write_queue_item_free(item); in save_state_queue_remove()
203 struct write_queue_item *item; in save_state_queue() local
216 item = new0(struct write_queue_item, 1); in save_state_queue()
217 if (!item) in save_state_queue()
220 item->file = TAKE_PTR(state_file); in save_state_queue()
221 item->rfkill_idx = event->idx; in save_state_queue()
222 item->state = event->soft; in save_state_queue()
224 LIST_APPEND(queue, c->write_queue, item); in save_state_queue()
245 static int save_state_write_one(struct write_queue_item *item) { in save_state_write_one() argument
248 …r = write_string_file(item->file, one_zero(item->state), WRITE_STRING_FILE_CREATE|WRITE_STRING_FIL… in save_state_write_one()
250 return log_error_errno(r, "Failed to write state file %s: %m", item->file); in save_state_write_one()
252 log_debug("Saved state '%s' to %s.", one_zero(item->state), item->file); in save_state_write_one()