Home
last modified time | relevance | path

Searched refs:path (Results 1 – 25 of 86) sorted by relevance

1234

/busybox-1.35.0/libbb/
Dremove_file.c13 int FAST_FUNC remove_file(const char *path, int flags) in remove_file() argument
17 if (lstat(path, &path_stat) < 0) { in remove_file()
19 bb_perror_msg("can't stat '%s'", path); in remove_file()
23 bb_perror_msg("can't remove '%s'", path); in remove_file()
35 bb_error_msg("'%s' is a directory", path); in remove_file()
39 if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0 && isatty(0)) in remove_file()
43 applet_name, path); in remove_file()
48 dp = opendir(path); in remove_file()
56 new_path = concat_subpath_file(path, d->d_name); in remove_file()
67 applet_name, path); in remove_file()
[all …]
Dxreadlink.c20 char* FAST_FUNC xmalloc_readlink(const char *path) in xmalloc_readlink() argument
30 readsize = readlink(path, buf, bufsize); in xmalloc_readlink()
52 char* FAST_FUNC xmalloc_follow_symlinks(const char *path) in xmalloc_follow_symlinks() argument
60 buf = xstrdup(path); in xmalloc_follow_symlinks()
94 char* FAST_FUNC xmalloc_readlink_or_warn(const char *path) in xmalloc_readlink_or_warn() argument
96 char *buf = xmalloc_readlink(path); in xmalloc_readlink_or_warn()
103 bb_error_msg("%s: cannot read link: %s", path, errmsg); in xmalloc_readlink_or_warn()
108 char* FAST_FUNC xmalloc_realpath(const char *path) in xmalloc_realpath() argument
117 return realpath(path, NULL); in xmalloc_realpath()
122 return xstrdup(realpath(path, buf)); in xmalloc_realpath()
[all …]
Dwfopen.c11 FILE* FAST_FUNC fopen_or_warn(const char *path, const char *mode) in fopen_or_warn() argument
13 FILE *fp = fopen(path, mode); in fopen_or_warn()
15 bb_simple_perror_msg(path); in fopen_or_warn()
21 FILE* FAST_FUNC fopen_for_read(const char *path) in fopen_for_read() argument
23 return fopen(path, "r"); in fopen_for_read()
26 FILE* FAST_FUNC xfopen_for_read(const char *path) in xfopen_for_read() argument
28 return xfopen(path, "r"); in xfopen_for_read()
31 FILE* FAST_FUNC fopen_for_write(const char *path) in fopen_for_write() argument
33 return fopen(path, "w"); in fopen_for_write()
36 FILE* FAST_FUNC xfopen_for_write(const char *path) in xfopen_for_write() argument
[all …]
Dget_last_path_component.c25 char* FAST_FUNC bb_get_last_path_component_nostrip(const char *path) in bb_get_last_path_component_nostrip() argument
27 char *slash = strrchr(path, '/'); in bb_get_last_path_component_nostrip()
29 if (!slash || (slash == path && !slash[1])) in bb_get_last_path_component_nostrip()
30 return (char*)path; in bb_get_last_path_component_nostrip()
41 char* FAST_FUNC bb_get_last_path_component_strip(char *path) in bb_get_last_path_component_strip() argument
43 char *slash = last_char_is(path, '/'); in bb_get_last_path_component_strip()
46 while (*slash == '/' && slash != path) in bb_get_last_path_component_strip()
49 return bb_get_last_path_component_nostrip(path); in bb_get_last_path_component_strip()
Dconcat_path_file.c18 char* FAST_FUNC concat_path_file(const char *path, const char *filename) in concat_path_file() argument
22 if (!path) in concat_path_file()
23 path = ""; in concat_path_file()
24 lc = last_char_is(path, '/'); in concat_path_file()
27 return xasprintf("%s%s%s", path, (lc==NULL ? "/" : ""), filename); in concat_path_file()
Dmake_directory.c27 int FAST_FUNC bb_make_directory(char *path, long mode, int flags) in bb_make_directory() argument
42 if (LONE_CHAR(path, '/')) in bb_make_directory()
44 if (path[0] == '.') { in bb_make_directory()
45 if (path[1] == '\0') in bb_make_directory()
52 s = path; in bb_make_directory()
96 if (mkdir(path, 0777) < 0) { in bb_make_directory()
101 || ((stat(path, &st) < 0) || !S_ISDIR(st.st_mode)) in bb_make_directory()
114 printf("created directory: '%s'\n", path); in bb_make_directory()
124 if (chmod(path, mode) < 0) { in bb_make_directory()
142 bb_perror_msg("can't %s directory '%s'", fail_msg, path); in bb_make_directory()
Dsimplify_path.c45 char* FAST_FUNC bb_simplify_path(const char *path) in bb_simplify_path() argument
49 if (path[0] == '/') in bb_simplify_path()
50 s = xstrdup(path); in bb_simplify_path()
53 s = concat_path_file(p, path); in bb_simplify_path()
Dconcat_subpath_file.c17 char* FAST_FUNC concat_subpath_file(const char *path, const char *f) in concat_subpath_file() argument
21 return concat_path_file(path, f); in concat_subpath_file()
Dpidfile.c16 void FAST_FUNC write_pidfile(const char *path) in write_pidfile() argument
23 if (!path) in write_pidfile()
26 pid_fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0666); in write_pidfile()
Dxfuncs_printf.c137 FILE* FAST_FUNC xfopen(const char *path, const char *mode) in xfopen() argument
139 FILE *fp = fopen(path, mode); in xfopen()
141 bb_perror_msg_and_die("can't open '%s'", path); in xfopen()
422 void FAST_FUNC xchdir(const char *path) in xchdir() argument
424 if (chdir(path)) in xchdir()
425 bb_perror_msg_and_die("can't change directory to '%s'", path); in xchdir()
434 void FAST_FUNC xchroot(const char *path) in xchroot() argument
436 if (chroot(path)) in xchroot()
437 bb_perror_msg_and_die("can't change root directory to '%s'", path); in xchroot()
442 DIR* FAST_FUNC warn_opendir(const char *path) in warn_opendir() argument
[all …]
/busybox-1.35.0/selinux/
Dmatchpathcon.c31 static int print_matchpathcon(char *path, int noprint) in print_matchpathcon() argument
34 int rc = matchpathcon(path, 0, &buf); in print_matchpathcon()
36 bb_perror_msg("matchpathcon(%s) failed", path); in print_matchpathcon()
40 printf("%s\t%s\n", path, buf); in print_matchpathcon()
59 char *fcontext, *prefix, *path; in matchpathcon_main() local
82 while ((path = *argv++) != NULL) { in matchpathcon_main()
87 error += print_matchpathcon(path, opts & OPT_NOT_PRINT); in matchpathcon_main()
91 if (selinux_file_context_verify(path, 0)) { in matchpathcon_main()
92 printf("%s verified\n", path); in matchpathcon_main()
97 rc = lgetfilecon_raw(path, &con); in matchpathcon_main()
[all …]
/busybox-1.35.0/coreutils/
Drmdir.c48 char *path; in rmdir_main() local
66 path = *argv; in rmdir_main()
70 printf("rmdir: removing directory, '%s'\n", path); in rmdir_main()
73 if (rmdir(path) < 0) { in rmdir_main()
78 bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */ in rmdir_main()
82 path = dirname(path); in rmdir_main()
86 if (NOT_LONE_CHAR(path, '.')) { in rmdir_main()
Dmktemp.c66 const char *path; in mktemp_main() local
78 path = getenv("TMPDIR"); in mktemp_main()
79 if (!path || path[0] == '\0') in mktemp_main()
80 path = "/tmp"; in mktemp_main()
91 , &path, &path in mktemp_main()
94 opts = getopt32(argv, "^" "dqtp:u" "\0" "?1"/*1 arg max*/, &path); in mktemp_main()
113 chp = concat_path_file(path, chp); in mktemp_main()
/busybox-1.35.0/util-linux/
Dnsenter.c63 char *path; /* optional path to a custom ns file */ member
134 static int open_by_path_or_target(const char *path, in open_by_path_or_target() argument
139 if (!path) { in open_by_path_or_target()
148 path = proc_path_buf; in open_by_path_or_target()
151 return xopen(path, O_RDONLY); in open_by_path_or_target()
171 &ns_ctx_list[NS_USR_POS].path, in nsenter_main()
172 &ns_ctx_list[NS_IPC_POS].path, in nsenter_main()
173 &ns_ctx_list[NS_UTS_POS].path, in nsenter_main()
174 &ns_ctx_list[NS_NET_POS].path, in nsenter_main()
175 &ns_ctx_list[NS_PID_POS].path, in nsenter_main()
[all …]
Dumount.c157 char *path; in umount_main() local
161 path = xstrdup(m->dir); in umount_main()
170 path = xmalloc_realpath(zapit); in umount_main()
171 if (path) { in umount_main()
173 if (strcmp(path, m->dir) == 0 || strcmp(path, m->device) == 0) in umount_main()
227 if ((opt & OPT_ALL) || strcmp(path, m->device) == 0) in umount_main()
230 free(path); in umount_main()
Dunshare.c98 char *path; member
183 if (!ns_ctx->path) in mount_namespaces()
186 mount_or_die(nsf, ns_ctx->path, NULL, MS_BIND); in mount_namespaces()
223 &ns_ctx_list[NS_MNT_POS].path, in unshare_main()
224 &ns_ctx_list[NS_UTS_POS].path, in unshare_main()
225 &ns_ctx_list[NS_IPC_POS].path, in unshare_main()
226 &ns_ctx_list[NS_NET_POS].path, in unshare_main()
227 &ns_ctx_list[NS_PID_POS].path, in unshare_main()
228 &ns_ctx_list[NS_USR_POS].path in unshare_main()
263 need_mount |= (uintptr_t)(ns_ctx->path); in unshare_main()
Dmkswap.c43 static void mkswap_selinux_setcontext(int fd, const char *path) in mkswap_selinux_setcontext() argument
50 xfstat(fd, &stbuf, path); in mkswap_selinux_setcontext()
59 if (matchpathcon(path, stbuf.st_mode, &oldcon) < 0) in mkswap_selinux_setcontext()
81 # define mkswap_selinux_setcontext(fd, path) ((void)0) argument
/busybox-1.35.0/e2fsprogs/
Dlsattr.c104 char *path; in lsattr_dir_proc() local
106 path = concat_path_file(dir_name, de->d_name); in lsattr_dir_proc()
108 if (lstat(path, &st) != 0) in lsattr_dir_proc()
109 bb_perror_msg("can't stat '%s'", path); in lsattr_dir_proc()
114 list_attributes(path); in lsattr_dir_proc()
119 printf("\n%s:\n", path); in lsattr_dir_proc()
120 iterate_on_dir(path, lsattr_dir_proc, NULL); in lsattr_dir_proc()
125 free(path); in lsattr_dir_proc()
/busybox-1.35.0/procps/
Dsmemcap.c29 static void writeheader(const char *path, struct stat *sb, int type) in writeheader() argument
34 strcpy(header.name, path); in writeheader()
45 static void archivefile(const char *path) in archivefile() argument
54 fd = open(path, O_RDONLY); in archivefile()
72 writeheader(path, &s, '0'); in archivefile()
85 char path[sizeof(long long)*3 + sizeof("/cmdline")]; in archivejoin() local
86 sprintf(path, "%s/%s", sub, name); in archivejoin()
87 archivefile(path); in archivejoin()
Dfuser.c106 static smallint scan_proc_net_or_maps(const char *path, unsigned port) in scan_proc_net_or_maps() argument
118 f = fopen_for_read(path); in scan_proc_net_or_maps()
172 static smallint scan_recursive(const char *path) in scan_recursive() argument
179 d = opendir(path); in scan_recursive()
191 subpath = concat_subpath_file(path, d_ent->d_name); in scan_recursive()
309 char path[sizeof("/proc/net/TCP6")]; in fuser_main() local
311 strcpy(path, "/proc/net/"); in fuser_main()
312 if (sscanf(*pp, "%u/%4s", &port, path + sizeof("/proc/net/")-1) == 2 in fuser_main()
313 && access(path, R_OK) == 0 in fuser_main()
316 scan_proc_net_or_maps(path, port); in fuser_main()
/busybox-1.35.0/modutils/
Dmodinfo.c61 static void modinfo(const char *path, const char *version, in modinfo() argument
72 the_module = xmalloc_open_zipped_read_close(path, &len); in modinfo()
74 if (path[0] == '/') in modinfo()
77 path = allocated = xasprintf("%s/%s/%s", CONFIG_DEFAULT_MODULES_DIR, version, path); in modinfo()
78 the_module = xmalloc_open_zipped_read_close(path, &len); in modinfo()
80 bb_error_msg("module '%s' not found", path); in modinfo()
97 display(path, shortcuts[0]); in modinfo()
/busybox-1.35.0/debianutils/
Dwhich.c57 char *path; in which_main() local
60 path = env_path; in which_main()
62 while ((p = find_executable(*argv, &path)) != NULL) { in which_main()
/busybox-1.35.0/miscutils/
Dubi_tools.c81 static unsigned get_num_from_file(const char *path, unsigned max) in get_num_from_file() argument
86 if (open_read_close(path, buf, sizeof(buf)) < 0) in get_num_from_file()
87 bb_perror_msg_and_die("can't open '%s'", path); in get_num_from_file()
90 bb_error_msg_and_die("number in '%s' is malformed or too large", path); in get_num_from_file()
127 char path[sizeof("/sys/class/ubi/ubi%d_%d/usable_eb_size") in ubi_tools_main() local
129 #define path_sys_class_ubi_ubi (path + sizeof("/sys/class/ubi/ubi")-1) in ubi_tools_main()
131 strcpy(path, "/sys/class/ubi/ubi"); in ubi_tools_main()
221 leb_avail = get_num_from_file(path, UINT_MAX); in ubi_tools_main()
224 leb_size = get_num_from_file(path, MAX_SANE_ERASEBLOCK); in ubi_tools_main()
321 leb_size = get_num_from_file(path, MAX_SANE_ERASEBLOCK); in ubi_tools_main()
Dinotifyd.c124 char *path = *argv; in inotifyd_main() local
125 char *masks = strchr(path, ':'); in inotifyd_main()
141 n = inotify_add_watch(pfd.fd, path, mask); in inotifyd_main()
143 bb_perror_msg_and_die("add watch (%s) failed", path); in inotifyd_main()
Dman.c197 static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) in add_MANPATH() argument
199 if (path) while (*path) { in add_MANPATH()
203 next_path = strchr(path, ':'); in add_MANPATH()
205 if (next_path == path) /* "::"? */ in add_MANPATH()
212 if (strcmp(*path_element, path) == 0) { in add_MANPATH()
218 man_path_list[*count_mp] = xstrdup(path); in add_MANPATH()
228 path = next_path + 1; in add_MANPATH()

1234