[PATCH v3 00/41] Add and use error_errno() and warning_errno()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Code changes compared to v2 is below (one incorrect conversion
reverted, two error message improvements). Other changes are text in
these commits, not shown as diff in this mail:

  [06/41] builtin/fetch.c: use error_errno()
  [08/41] builtin/mailsplit.c: use error_errno()
  [09/41] builtin/merge-file.c: use error_errno()
  [11/41] builtin/rm.c: use warning_errno()
  [14/41] builtin/worktree.c: use error_errno()
  [27/41] grep.c: use error_errno()

I didn't mention string format changes (e.g. from "abc (error)" to
"abc: error") in the commit messages though.

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index e18e190..1145747 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2018,7 +2018,7 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
 		ret = pthread_create(&p[i].thread, NULL,
 				     threaded_find_deltas, &p[i]);
 		if (ret)
-			die_errno("unable to create thread");
+			die("unable to create thread: %s", strerror(ret));
 		active_threads++;
 	}
 
diff --git a/builtin/rm.c b/builtin/rm.c
index 13b9639..fd47d20 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -152,7 +152,7 @@ static int check_local_mod(unsigned char *head, int index_only)
 
 		if (lstat(ce->name, &st) < 0) {
 			if (errno != ENOENT && errno != ENOTDIR)
-				warning_errno("'%s'", ce->name);
+				warning_errno(_("failed to stat '%s'"), ce->name);
 			/* It already vanished from the working tree */
 			continue;
 		}
diff --git a/grep.c b/grep.c
index 4f3779a..ec6f7ff 100644
--- a/grep.c
+++ b/grep.c
@@ -1732,7 +1732,7 @@ static int grep_source_load_file(struct grep_source *gs)
 	if (lstat(filename, &st) < 0) {
 	err_ret:
 		if (errno != ENOENT)
-			error_errno("'%s'", filename);
+			error_errno(_("failed to stat '%s'"), filename);
 		return -1;
 	}
 	if (!S_ISREG(st.st_mode))

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]