]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: add formats-util.h
authorRonny Chevalier <chevalier.ronny@gmail.com>
Fri, 10 Apr 2015 18:43:52 +0000 (20:43 +0200)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Fri, 10 Apr 2015 21:54:48 +0000 (23:54 +0200)
77 files changed:
src/bus-proxyd/bus-proxyd.c
src/bus-proxyd/bus-xml-policy.c
src/bus-proxyd/proxy.c
src/bus-proxyd/stdio-bridge.c
src/core/automount.c
src/core/busname.c
src/core/dbus-manager.c
src/core/execute.c
src/core/killall.c
src/core/main.c
src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c
src/core/unit-printf.c
src/core/unit.c
src/initctl/initctl.c
src/journal-remote/journal-upload.c
src/journal/journald-console.c
src/journal/journald-kmsg.c
src/journal/journald-server.c
src/journal/journald-syslog.c
src/journal/journald-wall.c
src/journal/journald.c
src/journal/sd-journal.c
src/journal/stacktrace.c
src/libsystemd/sd-bus/bus-creds.c
src/libsystemd/sd-bus/bus-dump.c
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/bus-socket.c
src/libsystemd/sd-bus/test-bus-chat.c
src/libsystemd/sd-login/sd-login.c
src/libsystemd/sd-login/test-login.c
src/libsystemd/sd-rtnl/rtnl-message.c
src/libudev/libudev-monitor.c
src/login/inhibit.c
src/login/logind-acl.c
src/login/logind-action.c
src/login/logind-dbus.c
src/login/logind-inhibit.c
src/login/logind-seat.c
src/login/logind-session.c
src/login/logind-user-dbus.c
src/login/logind-user.c
src/login/logind.c
src/login/pam_systemd.c
src/machine/machine-dbus.c
src/machine/machine.c
src/machine/machined-dbus.c
src/machine/machined.c
src/notify/notify.c
src/nspawn/nspawn.c
src/run/run.c
src/shared/ask-password-api.c
src/shared/cgroup-show.c
src/shared/cgroup-util.c
src/shared/clean-ipc.c
src/shared/formats-util.h [new file with mode: 0644]
src/shared/install-printf.c
src/shared/log.c
src/shared/logs-show.c
src/shared/socket-util.c
src/shared/util.c
src/shared/util.h
src/shutdownd/shutdownd.c
src/systemctl/systemctl.c
src/sysusers/sysusers.c
src/test/test-cgroup-util.c
src/test/test-log.c
src/test/test-tmpfiles.c
src/tmpfiles/tmpfiles.c
src/udev/udev-ctrl.c
src/udev/udev-event.c
src/udev/udev-node.c
src/udev/udevadm-monitor.c
src/udev/udevd.c
src/update-utmp/update-utmp.c

index d612816851291e02b2388460a72631474fe9d800..3e398b53e9c803251a9ed27e84a6ee156b39474e 100644 (file)
@@ -41,6 +41,7 @@
 #include "capability.h"
 #include "bus-xml-policy.h"
 #include "proxy.h"
+#include "formats-util.h"
 
 static char *arg_address = NULL;
 static char **arg_configuration = NULL;
index 497bce7b5699805d1b87968cb9a8c88040d1fb89..675d24485e4511923b8881059d1da000c22cbc3b 100644 (file)
@@ -27,6 +27,7 @@
 #include "bus-internal.h"
 #include "bus-xml-policy.h"
 #include "sd-login.h"
+#include "formats-util.h"
 
 static void policy_item_free(PolicyItem *i) {
         assert(i);
index c6896188533b1cdca258a62e4c7d9267385a073e..aa5010c1acb06f5371d6d413b41dbd3e1b618ef2 100644 (file)
@@ -42,6 +42,7 @@
 #include "driver.h"
 #include "proxy.h"
 #include "synthesize.h"
+#include "formats-util.h"
 
 static int proxy_create_destination(Proxy *p, const char *destination, const char *local_sec, bool negotiate_fds) {
         _cleanup_bus_close_unref_ sd_bus *b = NULL;
index 35e69a5c01276fb801a43a05a7c4f3393d344fc1..61bc08ae33d7744ad3fb26186158ea96d2bf0b89 100644 (file)
@@ -37,6 +37,7 @@
 #include "strv.h"
 #include "def.h"
 #include "proxy.h"
+#include "formats-util.h"
 
 static char *arg_address = NULL;
 static char *arg_command_line_buffer = NULL;
index f6a6ad5bfda4842c29cfb15050b7576ad00cdf66..e1ca2a48ca2cce73a6d112acc0b758ef37952ff6 100644 (file)
@@ -40,6 +40,7 @@
 #include "dbus-automount.h"
 #include "bus-util.h"
 #include "bus-error.h"
+#include "formats-util.h"
 
 static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
         [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
index 0ca9678a14728478c7906aa496bbc6268de1dfec..b1b953aadf5b793c079ea9d7391bcbbad22bd7c1 100644 (file)
@@ -30,6 +30,7 @@
 #include "bus-policy.h"
 #include "dbus-busname.h"
 #include "busname.h"
+#include "formats-util.h"
 
 static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = {
         [BUSNAME_DEAD] = UNIT_INACTIVE,
index 1b26e5556ad0973f6644e153f67de62b4addfae3..8821cc78205b1a88d6705731ab322c11be5981ff 100644 (file)
@@ -40,6 +40,7 @@
 #include "dbus-snapshot.h"
 #include "dbus-execute.h"
 #include "bus-common-errors.h"
+#include "formats-util.h"
 
 static int property_get_version(
                 sd_bus *bus,
index 768a32b31f7044aae8aea2eb9d12fe0f97d67b08..c87e9004bbcc77991ade4a18aaa45c6bc66bc5cb 100644 (file)
@@ -76,6 +76,7 @@
 #include "smack-util.h"
 #include "bus-endpoint.h"
 #include "cap-list.h"
+#include "formats-util.h"
 
 #ifdef HAVE_APPARMOR
 #include "apparmor-util.h"
index c6f1ddfec867fbb80a621e18faf6a7a4faf0cf81..504051467da877100ce5bdb05caf2142967cf3aa 100644 (file)
@@ -27,6 +27,7 @@
 #include "util.h"
 #include "killall.h"
 #include "set.h"
+#include "formats-util.h"
 
 #define TIMEOUT_USEC (10 * USEC_PER_SEC)
 
index dd8b65083bf9bfd3844d20d492cdf074800463b3..5d1aed8d3f84209607984e2c09533e8a13916d42 100644 (file)
@@ -72,6 +72,7 @@
 #include "ima-setup.h"
 #include "smack-setup.h"
 #include "kmod-setup.h"
+#include "formats-util.h"
 
 static enum {
         ACTION_RUN,
index c4aa810d05ec14e9e19c92b09458d71a444f74c0..8bfbbed2c0b172a0ed80b552923da96d4bfb6e80 100644 (file)
@@ -40,6 +40,7 @@
 #include "special.h"
 #include "exit-status.h"
 #include "fstab-util.h"
+#include "formats-util.h"
 
 #define RETRY_UMOUNT_MAX 32
 
index d9385504e8af7e65106e7192317f1f83cfa5ef77..c6ea6554f05503c558e3fb257efdd1c53e008a2e 100644 (file)
@@ -45,6 +45,7 @@
 #include "bus-error.h"
 #include "bus-util.h"
 #include "bus-kernel.h"
+#include "formats-util.h"
 
 static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
         [SERVICE_DEAD] = UNIT_INACTIVE,
index c81fd66eef43cac52ce457b759fd2c4ca0b8eda7..dd805d51df31c3f62ccd35f495d4270c7914c578 100644 (file)
@@ -48,6 +48,7 @@
 #include "dbus-socket.h"
 #include "unit.h"
 #include "socket.h"
+#include "formats-util.h"
 
 static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
         [SOCKET_DEAD] = UNIT_INACTIVE,
index 53f127484f6447cb4139750eff8ddb774eba1a5d..76660cc963003ef74f138b372af1fddfc30d4746 100644 (file)
@@ -35,6 +35,7 @@
 #include "virt.h"
 #include "udev-util.h"
 #include "fstab-util.h"
+#include "formats-util.h"
 
 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
         [SWAP_DEAD] = UNIT_INACTIVE,
index 90cb5040c19f7a88d3ef1e5881b8f7da68f7c0f4..bb4aa2121da5d2332e4b6d55e061e51aafd0ef74 100644 (file)
@@ -26,6 +26,7 @@
 #include "unit-printf.h"
 #include "macro.h"
 #include "cgroup-util.h"
+#include "formats-util.h"
 
 static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
         Unit *u = userdata;
index 7660d6b3672d40adb1ceffffc9d25ba50e616092..4b9c406e2e62a0238ba475e59e88e13004c8cfa0 100644 (file)
@@ -46,6 +46,7 @@
 #include "dbus.h"
 #include "execute.h"
 #include "dropin.h"
+#include "formats-util.h"
 
 const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
         [UNIT_SERVICE] = &service_vtable,
index ecec7a16a75c1aa81b38187cc96f2a0f0575ee96..19d6468fcc0c8999aec43c31c239c1c900df78da 100644 (file)
@@ -36,6 +36,7 @@
 #include "bus-util.h"
 #include "bus-error.h"
 #include "def.h"
+#include "formats-util.h"
 
 #define SERVER_FD_MAX 16
 #define TIMEOUT_MSEC ((int) (DEFAULT_EXIT_USEC/USEC_PER_MSEC))
index 75bb434c0861f44a9ca924682c07416f57ac3dc4..ddbb8731e265b198059b59191d7726c5e48e11f8 100644 (file)
@@ -34,6 +34,7 @@
 #include "conf-parser.h"
 #include "sigbus.h"
 #include "journal-upload.h"
+#include "formats-util.h"
 
 #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-upload.pem"
 #define CERT_FILE     CERTIFICATE_ROOT "/certs/journal-upload.pem"
index f7ea779f0b8e2b50b9bfd2646e9e7b9d436698e9..4ccacd7a5f5fadc591fcfe1e5bcf37370764387b 100644 (file)
@@ -26,6 +26,7 @@
 #include "fileio.h"
 #include "journald-server.h"
 #include "journald-console.h"
+#include "formats-util.h"
 
 static bool prefix_timestamp(void) {
 
index 80bd9cd1933005ae6a280beb3f76e49b1f4542b8..cb4bc38f2cd9cf567c49732e656bd7705c9ed99e 100644 (file)
@@ -31,6 +31,7 @@
 #include "journald-server.h"
 #include "journald-kmsg.h"
 #include "journald-syslog.h"
+#include "formats-util.h"
 
 void server_forward_kmsg(
         Server *s,
index 78d5b22ae124e984a5721a6e1065d83a50af8668..7e20b961a9b5d76e2e1b606b1a4566cbbba21686 100644 (file)
@@ -50,6 +50,7 @@
 #include "journald-audit.h"
 #include "journald-server.h"
 #include "acl-util.h"
+#include "formats-util.h"
 
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
index 7d545ca31d78b7b9b346806c75f00abb347bdf26..6c46a303599d3f704f2657465e2cd089fc032a65 100644 (file)
@@ -31,6 +31,7 @@
 #include "journald-kmsg.h"
 #include "journald-console.h"
 #include "journald-wall.h"
+#include "formats-util.h"
 
 /* Warn once every 30s if we missed syslog message */
 #define WARN_FORWARD_SYSLOG_MISSED_USEC (30 * USEC_PER_SEC)
index e3201674d4cb7dca6b6f89b36578c0f78da01177..b4e07179ac23d933599c316e9d5db7cdd6370878 100644 (file)
@@ -22,6 +22,7 @@
 #include "utmp-wtmp.h"
 #include "journald-server.h"
 #include "journald-wall.h"
+#include "formats-util.h"
 
 void server_forward_wall(
                 Server *s,
index 28a423326e4b0cb6006795829879565822e44aa7..b2624c6d28a0f2e1112eaa4b24d194def8c9e173 100644 (file)
@@ -30,6 +30,7 @@
 #include "journald-syslog.h"
 
 #include "sigbus.h"
+#include "formats-util.h"
 
 int main(int argc, char *argv[]) {
         Server server;
index 9b9e8ac8593e724f597802d3336651b96aa6773d..9f0f71aa815d4cfbd8e3a3eccd52fa11f7091ef8 100644 (file)
@@ -42,6 +42,7 @@
 #include "catalog.h"
 #include "replace-var.h"
 #include "fileio.h"
+#include "formats-util.h"
 
 #define JOURNAL_FILES_MAX 7168
 
index 6b9d2729f509e65406340bbd73b2db97e4ff3b55..706c08eac759833a636151da6a758371ec1903c7 100644 (file)
@@ -25,6 +25,7 @@
 #include "util.h"
 #include "macro.h"
 #include "stacktrace.h"
+#include "formats-util.h"
 
 #define FRAMES_MAX 64
 #define THREADS_MAX 64
index cd1c5e232ad07a35301d1302623605a658801761..4141cc3331c8ab7fbcf0a0adc0e9989732cf7453 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/capability.h>
 
 #include "util.h"
+#include "formats-util.h"
 #include "capability.h"
 #include "cgroup-util.h"
 #include "fileio.h"
index 4bc896549a464eded5e0035baa5f3d94b34aff8c..d722680ee5960c3e06ba9440a98d7d6d8011a28e 100644 (file)
@@ -24,6 +24,7 @@
 #include "strv.h"
 #include "macro.h"
 #include "cap-list.h"
+#include "formats-util.h"
 
 #include "bus-message.h"
 #include "bus-internal.h"
index 35c2aa6bee0021c98c7b8154a15664b55d25a0c7..0062e66d39bde5a5c230625bb2112fdcff228e57 100644 (file)
@@ -39,6 +39,7 @@
 #include "memfd-util.h"
 #include "capability.h"
 #include "fileio.h"
+#include "formats-util.h"
 
 #include "bus-internal.h"
 #include "bus-message.h"
index 873aede65e07e57432c0bebaf4c1d7fa3eec9bf0..f97e15d5d2c8b8a2ca82462098eb1520625eb131 100644 (file)
@@ -29,6 +29,7 @@
 #include "missing.h"
 #include "utf8.h"
 #include "sd-daemon.h"
+#include "formats-util.h"
 
 #include "sd-bus.h"
 #include "bus-socket.h"
index 7f49fe90fab2a255be6fb86d6246857df77eb874..ab2ec2788929f72c88c6d6beed121dba792e510a 100644 (file)
@@ -27,6 +27,7 @@
 #include "log.h"
 #include "util.h"
 #include "macro.h"
+#include "formats-util.h"
 
 #include "sd-bus.h"
 #include "bus-error.h"
index 072191e43f4d7e0023cdc2fcf0df679c90d82bd7..7b8f0636e5dc9eb421ae59c68329b83e1ca49085 100644 (file)
@@ -31,6 +31,7 @@
 #include "strv.h"
 #include "fileio.h"
 #include "login-shared.h"
+#include "formats-util.h"
 #include "sd-login.h"
 
 _public_ int sd_pid_get_session(pid_t pid, char **session) {
index 2802e8246d4b51a57343188fa1afbac00fba9e94..05affa442dbbf90b6e36a3dbd2436f195485fd9d 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "util.h"
 #include "strv.h"
+#include "formats-util.h"
 
 static void test_login(void) {
         _cleanup_close_pair_ int pair[2] = { -1, -1 };
index c938471fe30a957ec54427666a1aecf9b17c6872..4f994a10d3f3e108db4258a186c0a235abeda48b 100644 (file)
@@ -24,6 +24,7 @@
 #include <unistd.h>
 
 #include "util.h"
+#include "formats-util.h"
 #include "refcnt.h"
 #include "missing.h"
 
index c48ac78908a10d074b3d00897227142be71d8868..e9d403c2397464956b00e9a26d921b1a3330ac9e 100644 (file)
@@ -32,6 +32,7 @@
 #include "libudev-private.h"
 #include "socket-util.h"
 #include "missing.h"
+#include "formats-util.h"
 
 /**
  * SECTION:libudev-monitor
index 9f349b7c73e8e529b458e7879ebb9e654916f936..1f78e4b883d565179a354da6ffe19196e6fd403e 100644 (file)
@@ -31,6 +31,7 @@
 #include "util.h"
 #include "build.h"
 #include "strv.h"
+#include "formats-util.h"
 
 static const char* arg_what = "idle:sleep:shutdown";
 static const char* arg_who = NULL;
index d2b3337788920cb7a25507daed69ada64170a4a2..466225d69c7e84ee2a10300cabaef99f2b04dffe 100644 (file)
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include "util.h"
+#include "formats-util.h"
 #include "acl-util.h"
 #include "set.h"
 #include "logind-acl.h"
index 281e3c756913adb9c194cfe6523351df0af905b3..d7ae175bd3f947241c08de4413b4923b56945518 100644 (file)
@@ -27,6 +27,7 @@
 #include "bus-util.h"
 #include "bus-error.h"
 #include "logind-action.h"
+#include "formats-util.h"
 
 int manager_handle_action(
                 Manager *m,
index 9ba85d80a18bb3d7718e94e8cab1bbe6f612eb94..45aedad59480ead677e4153b622a05770e08da94 100644 (file)
@@ -40,6 +40,7 @@
 #include "selinux-util.h"
 #include "efivars.h"
 #include "logind.h"
+#include "formats-util.h"
 
 int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret) {
         _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
index 5eb1a2ea65f61c003298c3c1e000a0d20f5a4e23..68304a1610dd3b4b5a5c702ee4df78f933257395 100644 (file)
@@ -28,6 +28,7 @@
 #include "mkdir.h"
 #include "logind-inhibit.h"
 #include "fileio.h"
+#include "formats-util.h"
 
 Inhibitor* inhibitor_new(Manager *m, const char* id) {
         Inhibitor *i;
index 49808c928b0db389126e7365206ae18a0c6a6936..4c0bebd18c0b1e58de06f7e5c9d4226780fb992e 100644 (file)
@@ -29,6 +29,7 @@
 #include "logind-acl.h"
 #include "util.h"
 #include "mkdir.h"
+#include "formats-util.h"
 
 Seat *seat_new(Manager *m, const char *id) {
         Seat *s;
index 59f765782a668e5d92f188032ec5a848aa79dc11..cebc90ce54bcd40b3e7053a07984e6ad474a923f 100644 (file)
@@ -37,6 +37,7 @@
 #include "bus-util.h"
 #include "bus-error.h"
 #include "logind-session.h"
+#include "formats-util.h"
 
 #define RELEASE_USEC (20*USEC_PER_SEC)
 
index f7af8ff9b2bd1959d011a8c65560e7943a2786c2..03c33708fcc3e71a171166702af77a71a8b3658d 100644 (file)
@@ -26,6 +26,7 @@
 #include "bus-util.h"
 #include "logind.h"
 #include "logind-user.h"
+#include "formats-util.h"
 
 static int property_get_display(
                 sd_bus *bus,
index cba9cb60aa2dd03d44415b715ea52ae3e2323c23..b00e9b17dc72a2a354d0fe235bf32b07a60970bc 100644 (file)
@@ -38,6 +38,7 @@
 #include "clean-ipc.h"
 #include "logind-user.h"
 #include "smack-util.h"
+#include "formats-util.h"
 
 User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name) {
         User *u;
index e7880743a0657566c5ceea18cbb56c31ee627ff3..707d528fbbc5ff37a6545bd88c342f8f032a23b6 100644 (file)
@@ -32,6 +32,7 @@
 #include "bus-error.h"
 #include "logind.h"
 #include "udev-util.h"
+#include "formats-util.h"
 
 Manager *manager_new(void) {
         Manager *m;
index d7a708fd0a8e05ebb7c964ef5c80d0dad8c22bdc..a0fabfee67d82e99e5c90bc291ff518f5435b53f 100644 (file)
@@ -40,6 +40,7 @@
 #include "socket-util.h"
 #include "fileio.h"
 #include "bus-error.h"
+#include "formats-util.h"
 
 static int parse_argv(
                 pam_handle_t *handle,
index d6b8c90090fedeec14bcc0b2523f4d1265aa08b6..6cc46afbdde337b2c23a19035814b99ed39a0b0f 100644 (file)
@@ -42,6 +42,7 @@
 #include "bus-internal.h"
 #include "machine.h"
 #include "machine-dbus.h"
+#include "formats-util.h"
 
 static int property_get_id(
                 sd_bus *bus,
index 048607fb7f65762b59f41d45f97384cc8325b78e..dd073addec20d1d2c13b8b7827f54b4db351a9ad 100644 (file)
@@ -35,6 +35,7 @@
 #include "bus-error.h"
 #include "machine.h"
 #include "machine-dbus.h"
+#include "formats-util.h"
 
 Machine* machine_new(Manager *manager, const char *name) {
         Machine *m;
index 4d7409321b26b9efeb0a932b923ccdcf13f5ed3b..066a8da91849b36bfb8ea99485934da836c76073 100644 (file)
@@ -35,6 +35,7 @@
 #include "image-dbus.h"
 #include "machined.h"
 #include "machine-dbus.h"
+#include "formats-util.h"
 
 static int property_get_pool_path(
                 sd_bus *bus,
index f91f0671356b19f8acf4d5d5d6c23fdcc5a50581..7980293f8ba44a41c766bbc11a30c06cac0c2b72 100644 (file)
@@ -30,6 +30,7 @@
 #include "label.h"
 #include "machine-image.h"
 #include "machined.h"
+#include "formats-util.h"
 
 Manager *manager_new(void) {
         Manager *m;
index 00db75314ea499d6cc01490ae7bf42016a35a365..c920b2929721ed7565fb1498b0c93e8da73c4c47 100644 (file)
@@ -32,6 +32,7 @@
 #include "log.h"
 #include "build.h"
 #include "env-util.h"
+#include "formats-util.h"
 
 static bool arg_ready = false;
 static pid_t arg_pid = 0;
index 6789281d81a6e0d33edde721488e821fc1e9118b..8ec6743702d1b66130dc97e92003e694c00c4f30 100644 (file)
@@ -91,6 +91,7 @@
 #include "in-addr-util.h"
 #include "fw-util.h"
 #include "local-addresses.h"
+#include "formats-util.h"
 
 #ifdef HAVE_SECCOMP
 #include "seccomp-util.h"
index 3ded2c7e66ebd9a4cc427dcf9e53fa4e71303289..156824e0a517ad18eb090b610bc9d6cdf149d5ab 100644 (file)
@@ -34,6 +34,7 @@
 #include "bus-error.h"
 #include "calendarspec.h"
 #include "ptyfwd.h"
+#include "formats-util.h"
 
 static bool arg_scope = false;
 static bool arg_remain_after_exit = false;
index 44ebc584914a6b5092835f0560e8ca09c7e7c299..dfc89d23fd91cadb07d193fea2130bf65265c44f 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/signalfd.h>
 
 #include "util.h"
+#include "formats-util.h"
 #include "mkdir.h"
 #include "strv.h"
 
index cbd94e86d9166068e2dc657e7ed94c2f1f0b429c..fed72ac175addc2adef03b4a5f6e3907eeb4a0fb 100644 (file)
@@ -25,6 +25,7 @@
 #include <errno.h>
 
 #include "util.h"
+#include "formats-util.h"
 #include "macro.h"
 #include "path-util.h"
 #include "cgroup-util.h"
index b6fa386e9021a607a387942806230cfcd023ad0e..481708f19ef8e9a33576cd8314ba2a139ddb6cc2 100644 (file)
@@ -33,6 +33,7 @@
 #include "set.h"
 #include "macro.h"
 #include "util.h"
+#include "formats-util.h"
 #include "path-util.h"
 #include "unit-name.h"
 #include "fileio.h"
index ea781f5dea716b2ddcb296c1d33aa3be2a328f36..48b10865da1b49fbd2ab3ab5019e30116f26be02 100644 (file)
@@ -29,6 +29,7 @@
 #include <mqueue.h>
 
 #include "util.h"
+#include "formats-util.h"
 #include "strv.h"
 #include "clean-ipc.h"
 
diff --git a/src/shared/formats-util.h b/src/shared/formats-util.h
new file mode 100644 (file)
index 0000000..ce516b1
--- /dev/null
@@ -0,0 +1,63 @@
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2015 Ronny Chevalier
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <inttypes.h>
+
+#if SIZEOF_PID_T == 4
+#  define PID_PRI PRIi32
+#elif SIZEOF_PID_T == 2
+#  define PID_PRI PRIi16
+#else
+#  error Unknown pid_t size
+#endif
+#define PID_FMT "%" PID_PRI
+
+#if SIZEOF_UID_T == 4
+#  define UID_FMT "%" PRIu32
+#elif SIZEOF_UID_T == 2
+#  define UID_FMT "%" PRIu16
+#else
+#  error Unknown uid_t size
+#endif
+
+#if SIZEOF_GID_T == 4
+#  define GID_FMT "%" PRIu32
+#elif SIZEOF_GID_T == 2
+#  define GID_FMT "%" PRIu16
+#else
+#  error Unknown gid_t size
+#endif
+
+#if SIZEOF_TIME_T == 8
+#  define PRI_TIME PRIi64
+#elif SIZEOF_TIME_T == 4
+#  define PRI_TIME PRIu32
+#else
+#  error Unknown time_t size
+#endif
+
+#if SIZEOF_RLIM_T == 8
+#  define RLIM_FMT "%" PRIu64
+#elif SIZEOF_RLIM_T == 4
+#  define RLIM_FMT "%" PRIu32
+#else
+#  error Unknown rlim_t size
+#endif
index f62a0321e65c922db75e68ac64c9271607907cb8..999664942477de365530978e6b9b09f587405b2f 100644 (file)
@@ -25,6 +25,7 @@
 #include "unit-name.h"
 #include "util.h"
 #include "install-printf.h"
+#include "formats-util.h"
 
 static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
         InstallInfo *i = userdata;
index 646a1d6389822a358a3d2ec30c4b01497e9d29cf..32ec581d8d591e5b3bf9637b8505bfd9b0545dd3 100644 (file)
@@ -34,6 +34,7 @@
 #include "missing.h"
 #include "macro.h"
 #include "socket-util.h"
+#include "formats-util.h"
 
 #define SNDBUF_SIZE (8*1024*1024)
 
index 4e1b87814be77556fb940804247b2ff5051b1111..e179b8a7b4e20ddbca46bba2672b8c53c16a3907 100644 (file)
@@ -31,6 +31,7 @@
 #include "utf8.h"
 #include "hashmap.h"
 #include "journal-internal.h"
+#include "formats-util.h"
 
 /* up to three lines (each up to 100 characters),
    or 300 characters, whichever is less */
index 4a6bf50b17e9f91f274fab7e8236270378e781d6..94a066334547fe75e995e70fc03eca8afc7ab643 100644 (file)
@@ -35,6 +35,7 @@
 #include "socket-util.h"
 #include "missing.h"
 #include "fileio.h"
+#include "formats-util.h"
 
 int socket_address_parse(SocketAddress *a, const char *s) {
         char *e, *n;
index df5f8d10882737423746db7be2befdd70d039ea4..7321f1bcbbea71caf027fe20f6aeae04e054c755 100644 (file)
@@ -92,6 +92,7 @@
 #include "virt.h"
 #include "def.h"
 #include "sparse-endian.h"
+#include "formats-util.h"
 
 /* Put this test here for a lack of better place */
 assert_cc(EAGAIN == EWOULDBLOCK);
index 56e11c7961b2f556e7484db6b1fb2bc44f0085bd..d17b987f334fb9ea638ff7bba7249c5ee1d38871 100644 (file)
 #include <sys/inotify.h>
 #include <sys/statfs.h>
 
-#if SIZEOF_PID_T == 4
-#  define PID_PRI PRIi32
-#elif SIZEOF_PID_T == 2
-#  define PID_PRI PRIi16
-#else
-#  error Unknown pid_t size
-#endif
-#define PID_FMT "%" PID_PRI
-
-#if SIZEOF_UID_T == 4
-#  define UID_FMT "%" PRIu32
-#elif SIZEOF_UID_T == 2
-#  define UID_FMT "%" PRIu16
-#else
-#  error Unknown uid_t size
-#endif
-
-#if SIZEOF_GID_T == 4
-#  define GID_FMT "%" PRIu32
-#elif SIZEOF_GID_T == 2
-#  define GID_FMT "%" PRIu16
-#else
-#  error Unknown gid_t size
-#endif
-
-#if SIZEOF_TIME_T == 8
-#  define PRI_TIME PRIi64
-#elif SIZEOF_TIME_T == 4
-#  define PRI_TIME PRIu32
-#else
-#  error Unknown time_t size
-#endif
-
-#if SIZEOF_RLIM_T == 8
-#  define RLIM_FMT "%" PRIu64
-#elif SIZEOF_RLIM_T == 4
-#  define RLIM_FMT "%" PRIu32
-#else
-#  error Unknown rlim_t size
-#endif
-
 #include "macro.h"
 #include "missing.h"
 #include "time-util.h"
+#include "formats-util.h"
 
 /* What is interpreted as whitespace? */
 #define WHITESPACE " \t\n\r"
index 6e4511ecea718e7a97a274e8039210891ffe12c5..a05cddceb2e1ac821d36cb31b192e39ca0fa76a4 100644 (file)
@@ -35,6 +35,7 @@
 #include "utmp-wtmp.h"
 #include "mkdir.h"
 #include "fileio.h"
+#include "formats-util.h"
 
 union shutdown_buffer {
         struct sd_shutdown_command command;
index 9cb351de514a36e89458f03919708290e6376b2b..915482f6d49ccc094cdb3ebc4b18f8d01b7c1e1d 100644 (file)
@@ -69,6 +69,7 @@
 #include "mkdir.h"
 #include "dropin.h"
 #include "efivars.h"
+#include "formats-util.h"
 
 static char **arg_types = NULL;
 static char **arg_states = NULL;
index e549df6d3eedd2de5ac4940b9bddae5979316526..cc4c7ef53f499b0d8ac886bbebffcd5dc33431db 100644 (file)
@@ -38,6 +38,7 @@
 #include "fileio-label.h"
 #include "uid-range.h"
 #include "selinux-util.h"
+#include "formats-util.h"
 
 typedef enum ItemType {
         ADD_USER = 'u',
index 9834a6a1302c2e84ec8ed36a311bdef1878598f8..c0f4abe8665f7fb4a1af7b1396d00f7f5e723d4b 100644 (file)
@@ -23,6 +23,7 @@
 #include "util.h"
 #include "cgroup-util.h"
 #include "test-helper.h"
+#include "formats-util.h"
 
 static void check_p_d_u(const char *path, int code, const char *result) {
         _cleanup_free_ char *unit = NULL;
index ca64004b4c53a2a826c852c34f3f6d0496ce91d6..9dcfa2f2748edd47f1452d2ac0eea13b2d9c6a8c 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "formats-util.h"
 
 int main(int argc, char* argv[]) {
 
index 90e49d454233b393be27cb95e144a4de8969face..221dd67eb2f139346370cc21bdd68af34f30261b 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdio.h>
 
 #include "util.h"
+#include "formats-util.h"
 
 int main(int argc, char** argv) {
         const char *p = argv[1] ?: "/tmp";
index ad5f3f6c6ed8575bcfde5f74e97155c04d96f958..ef13dcb7498d0478c570a7775b1949e2906d29f1 100644 (file)
@@ -56,6 +56,7 @@
 #include "selinux-util.h"
 #include "btrfs-util.h"
 #include "acl-util.h"
+#include "formats-util.h"
 
 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
  * them in the file system. This is intended to be used to create
index 61d3c5b5575a616a60e3ed82be921038cf1a433e..0f357ba6c22a7f5122b1a685e98fc02ea948b514 100644 (file)
@@ -19,6 +19,7 @@
 #include <sys/un.h>
 
 #include "socket-util.h"
+#include "formats-util.h"
 #include "udev.h"
 
 /* wire protocol magic must match */
index 3a165b0b4fd03ec2ffffd989125da4b409c04342..bda06385eaa28a525c7c41cfeeb220ab581ef313 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "udev.h"
 #include "rtnl-util.h"
+#include "formats-util.h"
 
 struct udev_event *udev_event_new(struct udev_device *dev) {
         struct udev *udev = udev_device_get_udev(dev);
index debf9ea88bd610177823bd1c5524f2049ad63cc3..d824172b89b8057a5a1c66bf2306392b2f781497 100644 (file)
@@ -28,6 +28,7 @@
 #include "udev.h"
 #include "smack-util.h"
 #include "selinux-util.h"
+#include "formats-util.h"
 
 static int node_symlink(struct udev_device *dev, const char *node, const char *slink) {
         struct stat stats;
index 7ef2e68233deaf0f75731017e7d9685af3235b65..5e93955186f7b474d4fdba730c32d8aa2a07f260 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "udev.h"
 #include "udev-util.h"
+#include "formats-util.h"
 
 static bool udev_exit;
 
index 830aedd0fe1fdd10d9f201459230a1a1badfb5c3..a3f17c4b09220ead83beb8478371c2147ace2590 100644 (file)
@@ -48,6 +48,7 @@
 #include "selinux-util.h"
 #include "udev.h"
 #include "udev-util.h"
+#include "formats-util.h"
 
 static struct udev_rules *rules;
 static struct udev_ctrl *udev_ctrl;
index 33535ebd7ff98b7d416827f9ad76ab96b4680f51..ea9b0c9c8436054f2b1e7e2ab1da5814f3a3e854 100644 (file)
@@ -37,6 +37,7 @@
 #include "bus-util.h"
 #include "bus-error.h"
 #include "unit-name.h"
+#include "formats-util.h"
 
 typedef struct Context {
         sd_bus *bus;