Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115648229
D42842.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D42842.diff
View Options
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -335,7 +335,7 @@
*/
ev = malloc(no_files * 2 * sizeof(struct kevent));
if (ev == NULL)
- err(1, "Couldn't allocate memory for kevents.");
+ err(1, "failed to allocate memory for kevents");
set_events(files);
for (;;) {
diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c
--- a/usr.bin/tail/read.c
+++ b/usr.bin/tail/read.c
@@ -69,7 +69,7 @@
char *sp;
if ((sp = p = malloc(off)) == NULL)
- err(1, "malloc");
+ err(1, "failed to allocate memory");
for (wrap = 0, ep = p + off; (ch = getc(fp)) != EOF;) {
*p = ch;
@@ -143,7 +143,7 @@
int blen, cnt, recno, wrap;
if ((llines = calloc(off, sizeof(*llines))) == NULL)
- err(1, "calloc");
+ err(1, "failed to allocate memory");
p = sp = NULL;
blen = cnt = recno = wrap = 0;
rc = 0;
@@ -151,7 +151,7 @@
while ((ch = getc(fp)) != EOF) {
if (++cnt > blen) {
if ((sp = realloc(sp, blen += 1024)) == NULL)
- err(1, "realloc");
+ err(1, "failed to allocate memory");
p = sp + cnt - 1;
}
*p++ = ch;
@@ -160,7 +160,7 @@
llines[recno].blen = cnt + 256;
if ((llines[recno].l = realloc(llines[recno].l,
llines[recno].blen)) == NULL)
- err(1, "realloc");
+ err(1, "failed to allocate memory");
}
bcopy(sp, llines[recno].l, llines[recno].len = cnt);
cnt = 0;
diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c
--- a/usr.bin/tail/reverse.c
+++ b/usr.bin/tail/reverse.c
@@ -205,7 +205,7 @@
while ((tl = malloc(sizeof(bfelem_t))) == NULL) {
first = TAILQ_FIRST(&head);
if (TAILQ_EMPTY(&head))
- err(1, "malloc");
+ err(1, "failed to allocate memory");
enomem += first->len;
TAILQ_REMOVE(&head, first, entries);
free(first);
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -163,7 +163,7 @@
cap_rights_set(&rights, CAP_EVENT);
if (caph_rights_limit(STDIN_FILENO, &rights) < 0 ||
caph_limit_stderr() < 0 || caph_limit_stdout() < 0)
- err(1, "can't limit stdio rights");
+ err(1, "unable to limit stdio rights");
fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
if (fa == NULL)
@@ -203,7 +203,7 @@
if (*argv && fflag) {
files = malloc(no_files * sizeof(struct file_info));
if (files == NULL)
- err(1, "Couldn't malloc space for file descriptors.");
+ err(1, "failed to allocate memory for file descriptors");
for (filep = files; (fn = *argv++); filep++) {
filep->file_name = fn;
@@ -298,7 +298,7 @@
/* Malloc space for dash, new option and argument. */
len = strlen(*argv);
if ((start = p = malloc(len + 3)) == NULL)
- err(1, "malloc");
+ err(1, "failed to allocate memory");
*p++ = '-';
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 27, 1:04 PM (18 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17817962
Default Alt Text
D42842.diff (2 KB)
Attached To
Mode
D42842: tail: Clean up error messages.
Attached
Detach File
Event Timeline
Log In to Comment