summaryrefslogtreecommitdiff
path: root/lib/utils/mu-util.c
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2021-07-28 23:58:55 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2021-07-29 00:02:30 +0300
commitc8a2151cb9b8035f56d1e3301d9e6b2cf99a146e (patch)
tree305e2434545d88ad534ee6c576757ea2c2062cc8 /lib/utils/mu-util.c
parent71b9c7f59874b36b8be3f5cda3ceae527320113d (diff)
mu: use g_strerror instead of strerror
Some #includes were missing for the latter (but only noticeable on some systems - e.g., build breaks on Cygwin). So let's replace with something that works equally everywhere. Fixes: #2060
Diffstat (limited to 'lib/utils/mu-util.c')
-rw-r--r--lib/utils/mu-util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/utils/mu-util.c b/lib/utils/mu-util.c
index 816a70c..1742be6 100644
--- a/lib/utils/mu-util.c
+++ b/lib/utils/mu-util.c
@@ -110,7 +110,7 @@ mu_util_dir_expand (const char *path)
/* now resolve any symlinks, .. etc. */
if (realpath (dir, resolved) == NULL) {
/* g_debug ("%s: could not get realpath for '%s': %s", */
- /* __func__, dir, strerror(errno)); */
+ /* __func__, dir, g_strerror(errno)); */
g_free (dir);
return NULL;
} else
@@ -157,12 +157,12 @@ mu_util_check_dir (const gchar* path, gboolean readable, gboolean writeable)
mode = F_OK | (readable ? R_OK : 0) | (writeable ? W_OK : 0);
if (access (path, mode) != 0) {
- /* g_debug ("Cannot access %s: %s", path, strerror (errno)); */
+ /* g_debug ("Cannot access %s: %s", path, g_strerror (errno)); */
return FALSE;
}
if (stat (path, &statbuf) != 0) {
- /* g_debug ("Cannot stat %s: %s", path, strerror (errno)); */
+ /* g_debug ("Cannot stat %s: %s", path, g_strerror (errno)); */
return FALSE;
}
@@ -217,7 +217,7 @@ mu_util_create_dir_maybe (const gchar *path, mode_t mode, gboolean nowarn)
if (g_mkdir_with_parents (path, mode) != 0) {
if (!nowarn)
g_warning ("failed to create %s: %s",
- path, strerror(errno));
+ path, g_strerror(errno));
return FALSE;
}
@@ -355,7 +355,7 @@ mu_util_get_dtype (const char *path, gboolean use_lstat)
if (res != 0) {
g_warning ("%sstat failed on %s: %s",
- use_lstat ? "l" : "", path, strerror(errno));
+ use_lstat ? "l" : "", path, g_strerror(errno));
return DT_UNKNOWN;
}
@@ -496,7 +496,7 @@ mu_util_read_password (const char *prompt)
pass = getpass (prompt); /* returns static mem, don't free */
if (!pass) {
if (errno)
- g_warning ("error: %s", strerror(errno));
+ g_warning ("error: %s", g_strerror(errno));
return NULL;
}