[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] ftpfs: fix error handling in refresh_dir
From: |
Justus Winter |
Subject: |
[PATCH 1/5] ftpfs: fix error handling in refresh_dir |
Date: |
Mon, 16 Jun 2014 19:49:25 +0200 |
Found using the Clang Static Analyzer.
* ftpfs/dir.c (refresh_dir): Fix error handling.
---
ftpfs/dir.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/ftpfs/dir.c b/ftpfs/dir.c
index da5ddbe..a9fea22 100644
--- a/ftpfs/dir.c
+++ b/ftpfs/dir.c
@@ -384,14 +384,18 @@ refresh_dir (struct ftpfs_dir *dir, int update_stats,
time_t timestamp,
if (! err)
err = update_ordered_name ("..", &dfs);
- /* Refetch the directory from the server. */
- if (update_stats)
- /* Fetch both names and stat info. */
- err = ftp_conn_get_stats (conn, dir->rmt_path, 1,
- update_ordered_entry, &dfs);
- else
- /* Just fetch names. */
- err = ftp_conn_get_names (conn, dir->rmt_path, update_ordered_name, &dfs);
+ if (! err)
+ {
+ /* Refetch the directory from the server. */
+ if (update_stats)
+ /* Fetch both names and stat info. */
+ err = ftp_conn_get_stats (conn, dir->rmt_path, 1,
+ update_ordered_entry, &dfs);
+ else
+ /* Just fetch names. */
+ err = ftp_conn_get_names (conn, dir->rmt_path,
+ update_ordered_name, &dfs);
+ }
if (! err)
/* GC any directory entries that weren't seen this time. */
--
2.0.0
- [PATCH 1/5] ftpfs: fix error handling in refresh_dir,
Justus Winter <=
- [PATCH 2/5] libshouldbeinlibc: fix dead initialization in fmt_named_interval, Justus Winter, 2014/06/16
- [PATCH 4/5] libports: avoid realloc(3) corner case, Justus Winter, 2014/06/16
- [PATCH 3/5] trans/fakeroot: fix error handling, Justus Winter, 2014/06/16
- [PATCH 5/5] libdiskfs: add permission check to file_chflags, Justus Winter, 2014/06/16
- Re: [PATCH 1/5] ftpfs: fix error handling in refresh_dir, Samuel Thibault, 2014/06/17