Page MenuHomeFreeBSD

D56402.id175547.diff
No OneTemporary

D56402.id175547.diff

diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
--- a/usr.bin/du/du.1
+++ b/usr.bin/du/du.1
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 16, 2025
+.Dd April 15, 2026
.Dt DU 1
.Os
.Sh NAME
@@ -225,8 +225,8 @@
.Xr chflags 2 ,
.Xr fts 3 ,
.Xr libxo 3 ,
-.Xr xo_options 7 ,
.Xr symlink 7 ,
+.Xr xo_options 7 ,
.Xr quot 8
.Sh STANDARDS
The
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -35,7 +35,7 @@
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/stat.h>
-#include <err.h>
+
#include <errno.h>
#include <fnmatch.h>
#include <fts.h>
@@ -241,7 +241,7 @@
if (sflag)
depth = 0;
- if (!*argv) {
+ if (argc == 0) {
argv = save;
argv[0] = dot;
argv[1] = NULL;
@@ -264,8 +264,7 @@
(void)signal(SIGINFO, siginfo);
if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL)
- err(1, "fts_open");
-
+ xo_err(1, "fts_open");
xo_set_version(DU_XO_VERSION);
xo_open_container("disk-usage-information");
@@ -364,7 +363,7 @@
number_buckets = links_hash_initial_size;
buckets = malloc(number_buckets * sizeof(buckets[0]));
if (buckets == NULL)
- errx(1, "No memory for hardlink detection");
+ xo_errx(1, "No memory for hardlink detection");
for (i = 0; i < number_buckets; i++)
buckets[i] = NULL;
}
@@ -502,10 +501,10 @@
ign = calloc(1, sizeof(*ign));
if (ign == NULL)
- errx(1, "cannot allocate memory");
+ xo_errx(1, "cannot allocate memory");
ign->mask = strdup(mask);
if (ign->mask == NULL)
- errx(1, "cannot allocate memory");
+ xo_errx(1, "cannot allocate memory");
SLIST_INSERT_HEAD(&ignores, ign, next);
}
diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh
--- a/usr.bin/du/tests/du_test.sh
+++ b/usr.bin/du/tests/du_test.sh
@@ -295,6 +295,21 @@
sort du.out
}
+atf_test_case stdout
+stdout_head() {
+ atf_set descr "Failure to write to stdout"
+}
+stdout_body() {
+ (
+ trap "" PIPE
+ sleep 1
+ du 2>stderr
+ echo $? >result
+ ) | true
+ atf_check -o inline:"1\n" cat result
+ atf_check -o match:"stdout" cat stderr
+}
+
atf_init_test_cases()
{
atf_add_test_case A_flag
@@ -314,4 +329,5 @@
atf_add_test_case s_flag
atf_add_test_case si_flag
atf_add_test_case t_flag
+ atf_add_test_case stdout
}

File Metadata

Mime Type
text/plain
Expires
Fri, May 15, 9:26 AM (12 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33079217
Default Alt Text
D56402.id175547.diff (2 KB)

Event Timeline