diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-10-11 14:24:17 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-10-11 14:24:17 +0200 |
commit | b1d4b4bb3bd2d19a885675a09be834a93c6a95d5 (patch) | |
tree | d748497832c9ba38d47ad0e4db483e6423407f68 | |
parent | 15cb123c824c7589fb77569b639149cae8111226 (diff) | |
download | glib-b1d4b4bb3bd2d19a885675a09be834a93c6a95d5.tar.gz |
glocalfileinfo: Avoid getting unused type values
-rw-r--r-- | gio/glocalfileinfo.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 64930ef31..ecbc629c6 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -2690,8 +2690,6 @@ set_mtime_atime (char *filename, { int res; guint64 val = 0; - guint32 val_usec = 0; - guint32 val_nsec = 0; struct stat statbuf; gboolean got_stat = FALSE; #ifdef HAVE_UTIMENSAT @@ -2715,15 +2713,11 @@ set_mtime_atime (char *filename, #endif } } - - if (atime_usec_value) - { - if (!get_uint32 (atime_usec_value, &val_usec, error)) - return FALSE; - } if (atime_nsec_value) { + guint32 val_nsec = 0; + if (!get_uint32 (atime_nsec_value, &val_nsec, error)) return FALSE; times_n[0].tv_nsec = val_nsec; @@ -2747,14 +2741,11 @@ set_mtime_atime (char *filename, #endif } } - - if (mtime_usec_value) - { - if (!get_uint32 (mtime_usec_value, &val_usec, error)) - return FALSE; - } + if (mtime_nsec_value) { + guint32 val_nsec = 0; + if (!get_uint32 (mtime_nsec_value, &val_nsec, error)) return FALSE; times_n[1].tv_nsec = val_nsec; @@ -2789,15 +2780,12 @@ set_mtime_atime (char *filename, if (atime_usec_value) { + guint32 val_usec = 0; + if (!get_uint32 (atime_usec_value, &val_usec, error)) return FALSE; - times[0].tv_usec = val_usec; - } - if (atime_nsec_value) - { - if (!get_uint32 (atime_nsec_value, &val_nsec, error)) - return FALSE; + times[0].tv_usec = val_usec; } /* MTIME */ @@ -2823,15 +2811,12 @@ set_mtime_atime (char *filename, if (mtime_usec_value) { + guint32 val_usec = 0; + if (!get_uint32 (mtime_usec_value, &val_usec, error)) return FALSE; - times[1].tv_usec = val_usec; - } - if (mtime_nsec_value) - { - if (!get_uint32 (mtime_nsec_value, &val_nsec, error)) - return FALSE; + times[1].tv_usec = val_usec; } res = utimes (filename, times); |