diff options
author | наб <[email protected]> | 2021-05-08 15:04:48 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-05-21 10:16:14 -0700 |
commit | dd00925e8de33ca490d29b7b30fc8d2a14ab4da3 (patch) | |
tree | 84678868f09b25b3cadc57d2c1131bb2b0cff73d /cmd | |
parent | 93ef500388db2bf8e85446a3df0b013609cdbd73 (diff) |
zstreamdump: replace with link to zstream
zstreamdump(8) was in quite a bad state,
and the wrapper didn't work if invoked without /sbin in $PATH
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12015
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Makefile.am | 2 | ||||
-rw-r--r-- | cmd/zstream/Makefile.am | 3 | ||||
-rw-r--r-- | cmd/zstream/zstream.c | 5 | ||||
-rw-r--r-- | cmd/zstreamdump/Makefile.am | 1 | ||||
-rwxr-xr-x | cmd/zstreamdump/zstreamdump | 3 |
5 files changed, 9 insertions, 5 deletions
diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 473fcb0e0..a3db31679 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = zfs zpool zdb zhack zinject zstream zstreamdump ztest +SUBDIRS = zfs zpool zdb zhack zinject zstream ztest SUBDIRS += fsck_zfs vdev_id raidz_test zfs_ids_to_path SUBDIRS += zpool_influxdb diff --git a/cmd/zstream/Makefile.am b/cmd/zstream/Makefile.am index 69e1adbcb..f36e1e364 100644 --- a/cmd/zstream/Makefile.am +++ b/cmd/zstream/Makefile.am @@ -15,3 +15,6 @@ zstream_LDADD = \ $(abs_top_builddir)/lib/libnvpair/libnvpair.la include $(top_srcdir)/config/CppCheck.am + +install-exec-hook: + $(LN_S) zstream $(DESTDIR)$(sbindir)/zstreamdump diff --git a/cmd/zstream/zstream.c b/cmd/zstream/zstream.c index cbcb560a8..523ae0689 100644 --- a/cmd/zstream/zstream.c +++ b/cmd/zstream/zstream.c @@ -49,6 +49,11 @@ zstream_usage(void) int main(int argc, char *argv[]) { + char *basename = strrchr(argv[0], '/'); + basename = basename ? (basename + 1) : argv[0]; + if (argc >= 1 && strcmp(basename, "zstreamdump") == 0) + return (zstream_do_dump(argc, argv)); + if (argc < 2) zstream_usage(); diff --git a/cmd/zstreamdump/Makefile.am b/cmd/zstreamdump/Makefile.am deleted file mode 100644 index 2c04d8513..000000000 --- a/cmd/zstreamdump/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -dist_sbin_SCRIPTS = zstreamdump diff --git a/cmd/zstreamdump/zstreamdump b/cmd/zstreamdump/zstreamdump deleted file mode 100755 index 17f1aa4b2..000000000 --- a/cmd/zstreamdump/zstreamdump +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec zstream dump "$@" |