mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
Minor, insert '/' only if pasting components require it
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3ae609c341
commit
6f06c432ec
2 files changed
+3
-3
No files matched your search
+2
-2
@@ -68,7 +68,7 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
|
|||||||
svc_t *svc;
|
svc_t *svc;
|
||||||
|
|
||||||
_d("Got dir: %s, name: %s, mask: %08x", dir, name, mask);
|
_d("Got dir: %s, name: %s, mask: %08x", dir, name, mask);
|
||||||
snprintf(fn, sizeof(fn), "%s/%s", dir, name);
|
snprintf(fn, sizeof(fn), "%s%s%s", dir, fisslashdir(dir) ? "" : "/", name);
|
||||||
|
|
||||||
if (fnmatch("*\\.pid", fn, 0) && fnmatch("*/pid", fn, 0))
|
if (fnmatch("*\\.pid", fn, 0) && fnmatch("*/pid", fn, 0))
|
||||||
return;
|
return;
|
||||||
@@ -131,7 +131,7 @@ static void pidfile_handle_dir(struct iwatch *iw, char *dir, char *name, int mas
|
|||||||
char path[strlen(dir) + strlen(name) + 2];
|
char path[strlen(dir) + strlen(name) + 2];
|
||||||
struct iwatch_path *iwp;
|
struct iwatch_path *iwp;
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%s", dir, name);
|
snprintf(path, sizeof(path), "%s%s%s", dir, fisslashdir(dir) ? "" : "/", name);
|
||||||
_d("path: %s", path);
|
_d("path: %s", path);
|
||||||
|
|
||||||
iwp = iwatch_find_by_path(iw, path);
|
iwp = iwatch_find_by_path(iw, path);
|
||||||
|
|||||||
+1
-1
@@ -454,7 +454,7 @@ int run_parts(char *dir, char *cmd)
|
|||||||
int status;
|
int status;
|
||||||
int exit_status;
|
int exit_status;
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%s", dir, name);
|
snprintf(path, sizeof(path), "%s%s%s", dir, fisslashdir(dir) ? "" : "/", name);
|
||||||
if (stat(path, &st)) {
|
if (stat(path, &st)) {
|
||||||
_d("Failed stat(%s): %s", path, strerror(errno));
|
_d("Failed stat(%s): %s", path, strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in new issue
Block a user