Merge pull request #12119 from keszybz/voidify-mkdir-p
Voidify mkdir_p() and normalize util.h includes
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "acl-util.h"
|
||||
#include "alloc-util.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <linux/magic.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-device.h"
|
||||
#include "sd-id128.h"
|
||||
@@ -27,6 +28,7 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unaligned.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
static void boot_entry_free(BootEntry *entry) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "hashmap.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
|
||||
typedef enum BusTransport {
|
||||
BUS_TRANSPORT_LOCAL,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
|
||||
#define DEFAULT_WEIGHT 100
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio_ext.h>
|
||||
|
||||
+2
-1
@@ -4,10 +4,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
In case you wonder why we have our own JSON implementation, here are a couple of reasons why this implementation has
|
||||
|
||||
@@ -1032,7 +1032,7 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile
|
||||
}
|
||||
|
||||
if (p) {
|
||||
mkdir_p("/run/systemd/nspawn/locks", 0700);
|
||||
(void) mkdir_p("/run/systemd/nspawn/locks", 0700);
|
||||
|
||||
r = make_lock_file(p, operation, global);
|
||||
if (r < 0) {
|
||||
@@ -1169,8 +1169,6 @@ int image_read_metadata(Image *i) {
|
||||
}
|
||||
|
||||
int image_name_lock(const char *name, int operation, LockFile *ret) {
|
||||
const char *p;
|
||||
|
||||
assert(name);
|
||||
assert(ret);
|
||||
|
||||
@@ -1187,9 +1185,8 @@ int image_name_lock(const char *name, int operation, LockFile *ret) {
|
||||
if (streq(name, ".host"))
|
||||
return -EBUSY;
|
||||
|
||||
mkdir_p("/run/systemd/nspawn/locks", 0700);
|
||||
p = strjoina("/run/systemd/nspawn/locks/name-", name);
|
||||
|
||||
const char *p = strjoina("/run/systemd/nspawn/locks/name-", name);
|
||||
(void) mkdir_p("/run/systemd/nspawn/locks", 0700);
|
||||
return make_lock_file(p, operation, ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static pid_t pager_pid = 0;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "fdset.h"
|
||||
#include "macro.h"
|
||||
#include "time-util.h"
|
||||
|
||||
int serialize_item(FILE *f, const char *key, const char *value);
|
||||
int serialize_item_escaped(FILE *f, const char *key, const char *value);
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
***/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/fs.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "sd-id128.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "hostname-util.h"
|
||||
#include "macro.h"
|
||||
|
||||
Reference in New Issue
Block a user