diff options
-rw-r--r-- | sys-utils/nsenter.c | 10 | ||||
-rw-r--r-- | tests/expected/lsmem/lsmem-s390-zvm-6g | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c index 9c452c1d1..464f9f98c 100644 --- a/sys-utils/nsenter.c +++ b/sys-utils/nsenter.c @@ -238,6 +238,7 @@ int main(int argc, char *argv[]) int do_fork = -1; /* unknown yet */ uid_t uid = 0; gid_t gid = 0; + const char *rd_path = NULL, *wd_path = NULL; #ifdef HAVE_LIBSELINUX bool selinux = 0; #endif @@ -318,13 +319,13 @@ int main(int argc, char *argv[]) break; case 'r': if (optarg) - open_target_fd(&root_fd, "root", optarg); + rd_path = optarg; else do_rd = true; break; case 'w': if (optarg) - open_target_fd(&wd_fd, "cwd", optarg); + wd_path = optarg; else do_wd = true; break; @@ -433,6 +434,11 @@ int main(int argc, char *argv[]) } } + if (wd_path) + open_target_fd(&wd_fd, "cwd", wd_path); + if (rd_path) + open_target_fd(&root_fd, "root", rd_path); + /* Remember the current working directory if I'm not changing it */ if (root_fd >= 0 && wd_fd < 0) { wd_fd = open(".", O_RDONLY); diff --git a/tests/expected/lsmem/lsmem-s390-zvm-6g b/tests/expected/lsmem/lsmem-s390-zvm-6g index 02a9ddc9a..4cbf7f42c 100644 --- a/tests/expected/lsmem/lsmem-s390-zvm-6g +++ b/tests/expected/lsmem/lsmem-s390-zvm-6g @@ -139,10 +139,8 @@ RANGE SIZE STATE REMOVABLE BLOCK 0x00000000c0000000-0x00000000dfffffff 512M online yes 12-13 0x00000000e0000000-0x00000000efffffff 256M offline - 14 0x00000000f0000000-0x00000000ffffffff 256M online yes 15 -0x0000000100000000-0x000000010fffffff 256M online no 16 -0x0000000110000000-0x000000011fffffff 256M online no 17 -0x0000000120000000-0x000000012fffffff 256M online yes 18 -0x0000000130000000-0x000000013fffffff 256M online yes 19 +0x0000000100000000-0x000000011fffffff 512M online no 16-17 +0x0000000120000000-0x000000013fffffff 512M online yes 18-19 0x0000000140000000-0x000000017fffffff 1G offline - 20-23 Memory block size: 256M |