]>
Commit | Line | Data |
---|---|---|
e60fff65 JR |
1 | diff -ur systemd-183.orig/src/shared/cgroup-util.c systemd-183/src/shared/cgroup-util.c |
2 | --- systemd-183.orig/src/shared/cgroup-util.c 2012-05-08 13:54:22.000000000 +0200 | |
3 | +++ systemd-183/src/shared/cgroup-util.c 2012-05-29 12:17:52.837133271 +0200 | |
4 | @@ -1046,7 +1046,7 @@ | |
5 | assert(controller); | |
6 | assert(path); | |
7 | ||
8 | - if (!path_is_absolute(path) || | |
9 | + if (!sd_path_is_absolute(path) || | |
10 | controller[0] == 0 || | |
11 | strchr(controller, ':') || | |
12 | strchr(controller, '/')) | |
13 | diff -ur systemd-183.orig/src/shared/conf-parser.c systemd-183/src/shared/conf-parser.c | |
14 | --- systemd-183.orig/src/shared/conf-parser.c 2012-05-08 13:54:22.000000000 +0200 | |
15 | +++ systemd-183/src/shared/conf-parser.c 2012-05-29 12:17:29.397134096 +0200 | |
16 | @@ -635,7 +635,7 @@ | |
17 | return 0; | |
18 | } | |
19 | ||
20 | - if (!path_is_absolute(rvalue)) { | |
21 | + if (!sd_path_is_absolute(rvalue)) { | |
22 | log_error("[%s:%u] Not an absolute path, ignoring: %s", filename, line, rvalue); | |
23 | return 0; | |
24 | } | |
25 | @@ -768,7 +768,7 @@ | |
26 | continue; | |
27 | } | |
28 | ||
29 | - if (!path_is_absolute(n[k])) { | |
30 | + if (!sd_path_is_absolute(n[k])) { | |
31 | log_error("[%s:%u] Not an absolute path, ignoring: %s", filename, line, rvalue); | |
32 | free(n[k]); | |
33 | continue; | |
34 | diff -ur systemd-183.orig/src/shared/install.c systemd-183/src/shared/install.c | |
35 | --- systemd-183.orig/src/shared/install.c 2012-05-23 00:50:59.000000000 +0200 | |
36 | +++ systemd-183/src/shared/install.c 2012-05-29 12:17:43.047133614 +0200 | |
37 | @@ -461,14 +461,14 @@ | |
38 | ||
39 | /* Check if the symlink itself matches what we | |
40 | * are looking for */ | |
41 | - if (path_is_absolute(name)) | |
42 | + if (sd_path_is_absolute(name)) | |
43 | found_path = path_equal(p, name); | |
44 | else | |
45 | found_path = streq(de->d_name, name); | |
46 | ||
47 | /* Check if what the symlink points to | |
48 | * matches what we are looking for */ | |
49 | - if (path_is_absolute(name)) | |
50 | + if (sd_path_is_absolute(name)) | |
51 | found_dest = path_equal(dest, name); | |
52 | else | |
53 | found_dest = streq(path_get_file_name(dest), name); | |
54 | @@ -759,7 +759,7 @@ | |
55 | ||
56 | fn = path_get_file_name(*i); | |
57 | ||
58 | - if (!path_is_absolute(*i) || | |
59 | + if (!sd_path_is_absolute(*i) || | |
60 | !unit_name_is_valid_no_type(fn, true)) { | |
61 | if (r == 0) | |
62 | r = -EINVAL; | |
63 | @@ -972,7 +972,7 @@ | |
64 | assert(c); | |
65 | assert(name_or_path); | |
66 | ||
67 | - if (path_is_absolute(name_or_path)) | |
68 | + if (sd_path_is_absolute(name_or_path)) | |
69 | return install_info_add(c, NULL, name_or_path); | |
70 | else | |
71 | return install_info_add(c, name_or_path, NULL); | |
72 | diff -ur systemd-183.orig/src/shared/label.c systemd-183/src/shared/label.c | |
73 | --- systemd-183.orig/src/shared/label.c 2012-05-08 13:54:22.000000000 +0200 | |
74 | +++ systemd-183/src/shared/label.c 2012-05-29 12:19:01.103797530 +0200 | |
75 | @@ -274,12 +274,12 @@ | |
76 | if (!use_selinux() || !label_hnd) | |
77 | goto skipped; | |
78 | ||
79 | - if (path_is_absolute(path)) | |
80 | + if (sd_path_is_absolute(path)) | |
81 | r = selabel_lookup_raw(label_hnd, &fcon, path, S_IFDIR); | |
82 | else { | |
83 | char *newpath; | |
84 | ||
85 | - newpath = path_make_absolute_cwd(path); | |
86 | + newpath = sd_path_make_absolute_cwd(path); | |
87 | if (!newpath) | |
88 | return -ENOMEM; | |
89 | ||
90 | @@ -348,12 +348,12 @@ | |
91 | if (!path) | |
92 | return -ENOMEM; | |
93 | ||
94 | - if (path_is_absolute(path)) | |
95 | + if (sd_path_is_absolute(path)) | |
96 | r = selabel_lookup_raw(label_hnd, &fcon, path, S_IFSOCK); | |
97 | else { | |
98 | char *newpath; | |
99 | ||
100 | - newpath = path_make_absolute_cwd(path); | |
101 | + newpath = sd_path_make_absolute_cwd(path); | |
102 | ||
103 | if (!newpath) { | |
104 | free(path); | |
105 | diff -ur systemd-183.orig/src/shared/path-util.c systemd-183/src/shared/path-util.c | |
106 | --- systemd-183.orig/src/shared/path-util.c 2012-05-08 13:54:22.000000000 +0200 | |
107 | +++ systemd-183/src/shared/path-util.c 2012-05-29 12:19:13.310463764 +0200 | |
108 | @@ -36,7 +36,7 @@ | |
109 | #include "strv.h" | |
110 | #include "path-util.h" | |
111 | ||
112 | -bool path_is_absolute(const char *p) { | |
113 | +bool sd_path_is_absolute(const char *p) { | |
114 | return p[0] == '/'; | |
115 | } | |
116 | ||
117 | @@ -117,13 +117,13 @@ | |
118 | /* Makes every item in the list an absolute path by prepending | |
119 | * the prefix, if specified and necessary */ | |
120 | ||
121 | - if (path_is_absolute(p) || !prefix) | |
122 | + if (sd_path_is_absolute(p) || !prefix) | |
123 | return strdup(p); | |
124 | ||
125 | return join(prefix, "/", p, NULL); | |
126 | } | |
127 | ||
128 | -char *path_make_absolute_cwd(const char *p) { | |
129 | +char *sd_path_make_absolute_cwd(const char *p) { | |
130 | char *cwd, *r; | |
131 | ||
132 | assert(p); | |
133 | @@ -131,7 +131,7 @@ | |
134 | /* Similar to path_make_absolute(), but prefixes with the | |
135 | * current working directory. */ | |
136 | ||
137 | - if (path_is_absolute(p)) | |
138 | + if (sd_path_is_absolute(p)) | |
139 | return strdup(p); | |
140 | ||
141 | if (!(cwd = get_current_dir_name())) | |
142 | @@ -153,7 +153,7 @@ | |
143 | STRV_FOREACH(s, l) { | |
144 | char *t; | |
145 | ||
146 | - if (!(t = path_make_absolute_cwd(*s))) | |
147 | + if (!(t = sd_path_make_absolute_cwd(*s))) | |
148 | return NULL; | |
149 | ||
150 | free(*s); | |
151 | @@ -178,7 +178,7 @@ | |
152 | STRV_FOREACH(s, l) { | |
153 | char *t, *u; | |
154 | ||
155 | - t = path_make_absolute_cwd(*s); | |
156 | + t = sd_path_make_absolute_cwd(*s); | |
157 | free(*s); | |
158 | ||
159 | if (!t) { | |
160 | diff -ur systemd-183.orig/src/shared/path-util.h systemd-183/src/shared/path-util.h | |
161 | --- systemd-183.orig/src/shared/path-util.h 2012-05-08 23:35:09.000000000 +0200 | |
162 | +++ systemd-183/src/shared/path-util.h 2012-05-29 12:19:16.157130332 +0200 | |
163 | @@ -28,9 +28,9 @@ | |
164 | char **path_split_and_make_absolute(const char *p); | |
165 | char *path_get_file_name(const char *p); | |
166 | int path_get_parent(const char *path, char **parent); | |
167 | -bool path_is_absolute(const char *p); | |
168 | +bool sd_path_is_absolute(const char *p); | |
169 | char *path_make_absolute(const char *p, const char *prefix); | |
170 | -char *path_make_absolute_cwd(const char *p); | |
171 | +char *sd_path_make_absolute_cwd(const char *p); | |
172 | char *path_kill_slashes(char *path); | |
173 | bool path_startswith(const char *path, const char *prefix); | |
174 | bool path_equal(const char *a, const char *b); | |
175 | diff -ur systemd-183.orig/src/shared/util.c systemd-183/src/shared/util.c | |
176 | --- systemd-183.orig/src/shared/util.c 2012-05-22 16:10:22.000000000 +0200 | |
177 | +++ systemd-183/src/shared/util.c 2012-05-29 12:18:16.643799096 +0200 | |
178 | @@ -1380,7 +1380,7 @@ | |
179 | * filename, unless the latter is absolute anyway or the | |
180 | * former isn't */ | |
181 | ||
182 | - if (path_is_absolute(filename)) | |
183 | + if (sd_path_is_absolute(filename)) | |
184 | return strdup(filename); | |
185 | ||
186 | if (!(e = strrchr(path, '/'))) | |
187 | @@ -5365,7 +5365,7 @@ | |
188 | ||
189 | } | |
190 | ||
191 | -void* memdup(const void *p, size_t l) { | |
192 | +void* sd_memdup(const void *p, size_t l) { | |
193 | void *r; | |
194 | ||
195 | assert(p); | |
196 | diff -ur systemd-183.orig/src/shared/util.h systemd-183/src/shared/util.h | |
197 | --- systemd-183.orig/src/shared/util.h 2012-05-21 18:52:49.000000000 +0200 | |
198 | +++ systemd-183/src/shared/util.h 2012-05-29 12:15:17.357138754 +0200 | |
199 | @@ -103,7 +103,7 @@ | |
200 | ||
201 | #define newa(t, n) ((t*) alloca(sizeof(t)*(n))) | |
202 | ||
203 | -#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))) | |
204 | +#define newdup(t, p, n) ((t*) sd_memdup(p, sizeof(t)*(n))) | |
205 | ||
206 | #define malloc0(n) (calloc((n), 1)) | |
207 | ||
208 | @@ -495,7 +495,7 @@ | |
209 | ||
210 | int fd_wait_for_event(int fd, int event, usec_t timeout); | |
211 | ||
212 | -void* memdup(const void *p, size_t l); | |
213 | +void* sd_memdup(const void *p, size_t l); | |
214 | ||
215 | int is_kernel_thread(pid_t pid); | |
216 |