/busybox-1.35.0/coreutils/ |
D | tee.c | 63 FILE **fp; in tee_main() local 90 fp = files = xzalloc(sizeof(FILE *) * (argc + 2)); in tee_main() 97 *fp = stdout; in tee_main() 99 *fp = fopen_or_warn(*argv, mode); in tee_main() 100 if (*fp == NULL) { in tee_main() 108 setbuf(*fp, NULL); /* tee must not buffer output. */ in tee_main() 109 fp++; in tee_main() 116 fp = files; in tee_main() 118 fwrite(buf, 1, c, *fp); in tee_main() 120 while (*++fp); in tee_main() [all …]
|
D | head.c | 55 # define print_first_N(fp,count,bytes) print_first_N(fp,count) argument 58 print_first_N(FILE *fp, unsigned long count, bool count_bytes) in print_first_N() argument 64 int c = getc(fp); in print_first_N() 75 print_except_N_last_bytes(FILE *fp, unsigned count) in print_except_N_last_bytes() argument 81 c = getc(fp); in print_except_N_last_bytes() 93 c = getc(fp); in print_except_N_last_bytes() 104 print_except_N_last_lines(FILE *fp, unsigned count) in print_except_N_last_lines() argument 110 c = xmalloc_fgets(fp); in print_except_N_last_lines() 122 c = xmalloc_fgets(fp); in print_except_N_last_lines() 139 void print_except_N_last_bytes(FILE *fp, unsigned count); [all …]
|
D | wc.c | 145 FILE *fp; in wc_main() local 152 fp = fopen_or_warn_stdin(arg); in wc_main() 153 if (!fp) { in wc_main() 166 c = getc(fp); in wc_main() 168 if (ferror(fp)) { in wc_main() 221 fclose_if_not_stdin(fp); in wc_main()
|
D | shuf.c | 129 FILE *fp; in shuf_main() local 138 fp = xfopen_stdin(fname); in shuf_main() 142 char *line = xmalloc_fgetline(fp); in shuf_main() 148 fclose_if_not_stdin(fp); in shuf_main()
|
/busybox-1.35.0/libbb/ |
D | wfopen_input.c | 18 FILE *fp = stdin; in fopen_or_warn_stdin() local 23 fp = fopen_or_warn(filename, "r"); in fopen_or_warn_stdin() 25 return fp; in fopen_or_warn_stdin() 30 FILE *fp = fopen_or_warn_stdin(filename); in xfopen_stdin() local 31 if (fp) in xfopen_stdin() 32 return fp; in xfopen_stdin()
|
D | wfopen.c | 13 FILE *fp = fopen(path, mode); in fopen_or_warn() local 14 if (!fp) { in fopen_or_warn() 18 return fp; in fopen_or_warn() 43 FILE* fp = fdopen(fd_and_rw_bit >> 1, fd_and_rw_bit & 1 ? "w" : "r"); in xfdopen_helper() local 44 if (!fp) in xfdopen_helper() 46 return fp; in xfdopen_helper()
|
D | get_cpu_count.c | 24 FILE *fp; in get_cpu_count() local 28 fp = xfopen_for_read("/proc/stat"); in get_cpu_count() 29 while (fgets(line, sizeof(line), fp)) { in get_cpu_count() 45 fclose(fp); in get_cpu_count()
|
D | login.c | 21 FILE *fp; in print_login_issue() local 33 fp = fopen_for_read(issue_file); in print_login_issue() 34 if (!fp) in print_login_issue() 36 while ((c = fgetc(fp)) != EOF) { in print_login_issue() 45 c = fgetc(fp); in print_login_issue() 125 fclose(fp); in print_login_issue()
|
D | print_numbered_lines.c | 13 FILE *fp = fopen_or_warn_stdin(filename); in print_numbered_lines() local 17 if (!fp) in print_numbered_lines() 21 while ((line = xmalloc_fgetline(fp)) != NULL) { in print_numbered_lines() 34 fclose(fp); in print_numbered_lines()
|
D | parse_config.c | 71 FILE* fp; in config_open2() local 74 fp = fopen_func(filename); in config_open2() 75 if (!fp) in config_open2() 78 parser->fp = fp; in config_open2() 92 fclose(parser->fp); in config_close() 109 len = getline(&parser->line, &parser->line_alloc, parser->fp); in get_line_with_continuation() 122 nlen = getline(&parser->nline, &parser->nline_alloc, parser->fp); in get_line_with_continuation()
|
D | ask_confirmation.c | 14 int FAST_FUNC bb_ask_y_confirmation_FILE(FILE *fp) in bb_ask_y_confirmation_FILE() argument 20 while (((c = fgetc(fp)) != EOF) && (c != '\n')) { in bb_ask_y_confirmation_FILE()
|
/busybox-1.35.0/libpwdgrp/ |
D | pwd_grp.c | 47 FILE *fp; member 188 static char *parse_common(FILE *fp, struct passdb *db, in parse_common() argument 193 while ((buf = xmalloc_fgetline(fp)) != NULL) { in parse_common() 240 FILE *fp = fopen_for_read(db->filename); in parse_file() local 242 if (fp) { in parse_file() 243 buf = parse_common(fp, db, key, field_pos); in parse_file() 244 fclose(fp); in parse_file() 399 if (!db->fp) { in getXXent_r() 400 db->fp = fopen_for_read(db->filename); in getXXent_r() 401 if (!db->fp) { in getXXent_r() [all …]
|
/busybox-1.35.0/util-linux/ |
D | rev.c | 70 FILE *fp; in rev_main() local 72 fp = fopen_or_warn_stdin(*argv++); in rev_main() 73 if (!fp) { in rev_main() 82 if (!fgets(buf + pos, bufsize - pos, fp)) in rev_main() 86 && !feof(fp) in rev_main() 114 fclose(fp); in rev_main()
|
D | hexdump.c | 60 FILE *fp; in bb_dump_addfile() local 63 fp = xfopen_for_read(name); in bb_dump_addfile() 64 while ((buf = xmalloc_fgetline(fp)) != NULL) { in bb_dump_addfile() 71 fclose(fp); in bb_dump_addfile()
|
D | fatattr.c | 49 const char *fp = strchr(bit_to_char, c); in get_flag() local 50 if (!fp) in get_flag() 52 return 1 << (fp - bit_to_char); in get_flag()
|
D | umount.c | 98 FILE *fp; in umount_main() local 126 fp = setmntent(bb_path_mtab_file, "r"); in umount_main() 127 if (!fp) { in umount_main() 132 while (getmntent_r(fp, &me, bb_common_bufsiz1, COMMON_BUFSIZE)) { in umount_main() 142 endmntent(fp); in umount_main()
|
/busybox-1.35.0/procps/ |
D | powertop.c | 118 FILE *fp = fopen_for_write(fname); in write_str_to_file() local 119 if (!fp) in write_str_to_file() 121 fputs(str, fp); in write_str_to_file() 122 fclose(fp); in write_str_to_file() 172 FILE *fp; in read_cstate_counts() local 182 fp = fopen_for_read(buf); in read_cstate_counts() 183 if (!fp) in read_cstate_counts() 195 while (fgets(buf, sizeof(buf), fp)) { in read_cstate_counts() 213 fclose(fp); in read_cstate_counts() 247 FILE *fp; in is_hpet_irq() local [all …]
|
D | free.c | 84 FILE *fp; in parse_meminfo() local 87 fp = xfopen_for_read("/proc/meminfo"); in parse_meminfo() 90 while (fgets(buf, sizeof(buf), fp)) { in parse_meminfo() 102 fclose(fp); in parse_meminfo()
|
D | mpstat.c | 458 FILE *fp; in get_cpu_statistics() local 461 fp = xfopen_for_read(PROCFS_STAT); in get_cpu_statistics() 463 while (fgets(buf, sizeof(buf), fp)) { in get_cpu_statistics() 514 fclose(fp); in get_cpu_statistics() 522 FILE *fp; in get_irqs_from_stat() local 525 fp = xfopen_for_read(PROCFS_STAT); in get_irqs_from_stat() 527 while (fgets(buf, sizeof(buf), fp)) { in get_irqs_from_stat() 535 fclose(fp); in get_irqs_from_stat() 545 FILE *fp; in get_irqs_from_interrupts() local 568 fp = fopen_for_read(fname); in get_irqs_from_interrupts() [all …]
|
D | iostat.c | 149 FILE *fp; in get_smp_uptime() local 152 fp = xfopen_for_read("/proc/uptime"); in get_smp_uptime() 154 if (fscanf(fp, "%lu.%lu", &sec, &dec) != 2) in get_smp_uptime() 157 fclose(fp); in get_smp_uptime() 165 FILE *fp; in get_cpu_statistics() local 168 fp = xfopen_for_read("/proc/stat"); in get_cpu_statistics() 172 while (fgets(buf, sizeof(buf), fp)) { in get_cpu_statistics() 196 fclose(fp); in get_cpu_statistics() 328 FILE *fp; in do_disk_statistics() local 331 fp = xfopen_for_read("/proc/diskstats"); in do_disk_statistics() [all …]
|
/busybox-1.35.0/networking/ |
D | httpd_ssi.c | 66 FILE *fp = fopen(filename, "r"); in process_includes() local 67 if (!fp) in process_includes() 84 while (fgets(line, sizeof(line), fp)) { in process_includes() 143 fclose(fp); in process_includes()
|
D | whois.c | 38 FILE *fp; in query() local 53 fp = xfdopen_for_read(fd); in query() 57 && fgets(linebuf, sizeof(linebuf)-1, fp) in query() 86 fclose(fp); /* closes fd too */ in query()
|
/busybox-1.35.0/mailutils/ |
D | popmaildir.c | 208 FILE *fp; in popmaildir_main() local 224 fp = popen(delivery, "w"); in popmaildir_main() 226 if (!fp) { in popmaildir_main() 233 fp = xfopen_for_write(filename); in popmaildir_main() 245 fputs(s, fp); in popmaildir_main() 252 rc = pclose(fp); in popmaildir_main() 260 fclose(fp); in popmaildir_main()
|
/busybox-1.35.0/sysklogd/ |
D | klogd.c | 121 FILE *fp = fopen_or_warn(PATH_PRINTK, "w"); in klogd_setloglevel() local 122 if (fp) { in klogd_setloglevel() 129 fprintf(fp, "%u\n", lvl); in klogd_setloglevel() 130 fclose(fp); in klogd_setloglevel()
|
/busybox-1.35.0/init/ |
D | bootchartd.c | 121 static void dump_file(FILE *fp, const char *filename) in dump_file() argument 125 fputs(G.jiffy_line, fp); in dump_file() 126 fflush(fp); in dump_file() 127 bb_copyfd_eof(fd, fileno(fp)); in dump_file() 129 fputc('\n', fp); in dump_file() 133 static int dump_procs(FILE *fp, int look_for_login_process) in dump_procs() argument 139 fputs(G.jiffy_line, fp); in dump_procs() 164 fputs(stat_line, fp); in dump_procs() 183 fputc('\n', fp); in dump_procs()
|