Skip to content

Commit

Permalink
remove opt_nocopyzero setting globally, since unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Zimmermann committed Jan 18, 2025
1 parent 46e8834 commit 4f02835
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
7 changes: 0 additions & 7 deletions elks/tools/mfs/genfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,6 @@ compile_fs(struct minix_fs_dat *fs)
av[2] = 0;
cmd_mkdir(fs, 2, av, sb.st_mode & 0777);
} else if (flags == S_IFREG) {
if (opt_nocopyzero && !inode_build->blocks) {
char *p = strrchr(inode_build->path, '/');
if (p && *++p == '.') {
if (opt_verbose) printf("Skipping %s\n", inode_build->path);
continue;
}
}
if (opt_verbose) printf("cp %s %s\n", inode_build->path, prefix+inode_build->path);
av[0] = "cp";
av[1] = inode_build->path;
Expand Down
10 changes: 3 additions & 7 deletions elks/tools/mfs/mkfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <sys/stat.h>
#include <stdlib.h>

int opt_nocopyzero = 0; /* don't copy zero-length files starting with . */
int opt_appendifexists = 0; /* don't create new fs on genfs if exists */

/**
Expand Down Expand Up @@ -76,12 +75,9 @@ void parse_mkfs(int argc,char **argv,int *magic_p,int *nblks_p,int *inodes_p) {
case 's':
*nblks_p = atoi(optarg);
break;
case 'k':
opt_nocopyzero = 1;
break;
case 'a':
opt_appendifexists = 1;
break;
case 'a':
opt_appendifexists = 1;
break;
default:
usage(argv[0]);
}
Expand Down
1 change: 0 additions & 1 deletion elks/tools/mfs/protos.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ extern int opt_keepuid;
extern int opt_fsbad_fatal;
extern char *toolname;

extern int opt_nocopyzero;
extern int opt_appendifexists;

extern char *optarg;
Expand Down
9 changes: 0 additions & 9 deletions elkscmd/file_utils/cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

int opt_recurse; /* implicitly initialized */
int opt_verbose;
int opt_nocopyzero;
int opt_force;
int whole_disk_copy;
char *destination_dir;
Expand Down Expand Up @@ -329,14 +328,6 @@ static int do_copies(void)

err |= do_mkdir(inode_build->path, destdir(inode_build->path));
} else if (flags == S_IFREG) {
if (opt_nocopyzero && !inode_build->blocks) {
char *p = strrchr(inode_build->path, '/');
if (p && *++p == '.') {
if (opt_verbose)
printf("Skipping zero length %s\n", inode_build->path);
continue;
}
}

err |= do_cp(inode_build->path, destdir(inode_build->path));
} else if (flags == S_IFCHR) {
Expand Down

0 comments on commit 4f02835

Please sign in to comment.