commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 15/31: libtrivfs: fix error handling


From: Samuel Thibault
Subject: [hurd] 15/31: libtrivfs: fix error handling
Date: Mon, 02 May 2016 23:48:32 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit d67a86c9690c2a9984ca6e9f3c376956495897f4
Author: Justus Winter <address@hidden>
Date:   Mon Apr 25 00:48:56 2016 +0200

    libtrivfs: fix error handling
    
    * libtrivfs/times.c (trivfs_set_{a,m}time): Fix error handling.
---
 libtrivfs/times.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/libtrivfs/times.c b/libtrivfs/times.c
index 5f08cb1..42e668d 100644
--- a/libtrivfs/times.c
+++ b/libtrivfs/times.c
@@ -20,29 +20,37 @@
 error_t
 trivfs_set_atime (struct trivfs_control *cntl)
 {
+  error_t err;
   struct stat st;
   time_value_t atime;
   time_value_t mtime;
-  
-  io_stat (cntl->underlying, &st);
+
+  err = io_stat (cntl->underlying, &st);
+  if (err)
+    return err;
+
   mtime.seconds = st.st_mtim.tv_sec;
   mtime.microseconds = st.st_mtim.tv_nsec / 1000;
   atime.microseconds = -1;
-  file_utimes (cntl->underlying, atime, mtime);
-  return 0;
+
+  return file_utimes (cntl->underlying, atime, mtime);
 }
 
 error_t
 trivfs_set_mtime (struct trivfs_control *cntl)
 {
+  error_t err;
   struct stat st;
   time_value_t atime;
   time_value_t mtime;
 
-  io_stat (cntl->underlying, &st);
+  err = io_stat (cntl->underlying, &st);
+  if (err)
+    return err;
+
   atime.seconds = st.st_atim.tv_sec;
   atime.microseconds = st.st_atim.tv_nsec / 1000;
   mtime.microseconds = -1;
-  file_utimes (cntl->underlying, atime, mtime);
-  return 0;
+
+  return file_utimes (cntl->underlying, atime, mtime);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]