Blame SOURCES/0024-Introduce-new-return-value-450.patch

d7fdbd
From 1d5cdf309387ff92988ab17d746f015d833a4b92 Mon Sep 17 00:00:00 2001
d7fdbd
From: Martin Sehnoutka <msehnout@redhat.com>
d7fdbd
Date: Thu, 17 Nov 2016 11:08:52 +0100
d7fdbd
Subject: [PATCH 24/59] Introduce new return value 450:
d7fdbd
d7fdbd
 *450 Requested file action not taken.
d7fdbd
      File unavailable (e.g., file busy).
d7fdbd
---
d7fdbd
 ftpcodes.h  | 1 +
d7fdbd
 postlogin.c | 9 ++++++++-
d7fdbd
 sysutil.c   | 3 +++
d7fdbd
 sysutil.h   | 3 ++-
d7fdbd
 4 files changed, 14 insertions(+), 2 deletions(-)
d7fdbd
d7fdbd
diff --git a/ftpcodes.h b/ftpcodes.h
d7fdbd
index 93290c0..81e25c5 100644
d7fdbd
--- a/ftpcodes.h
d7fdbd
+++ b/ftpcodes.h
d7fdbd
@@ -52,6 +52,7 @@
d7fdbd
 #define FTP_TLS_FAIL          421
d7fdbd
 #define FTP_BADSENDCONN       425
d7fdbd
 #define FTP_BADSENDNET        426
d7fdbd
+#define FTP_FILETMPFAIL       450
d7fdbd
 #define FTP_BADSENDFILE       451
d7fdbd
 
d7fdbd
 #define FTP_BADCMD            500
d7fdbd
diff --git a/postlogin.c b/postlogin.c
d7fdbd
index bf12970..29958c0 100644
d7fdbd
--- a/postlogin.c
d7fdbd
+++ b/postlogin.c
d7fdbd
@@ -679,7 +679,14 @@ handle_retr(struct vsf_session* p_sess, int is_http)
d7fdbd
   opened_file = str_open(&p_sess->ftp_arg_str, kVSFSysStrOpenReadOnly);
d7fdbd
   if (vsf_sysutil_retval_is_error(opened_file))
d7fdbd
   {
d7fdbd
-    vsf_cmdio_write(p_sess, FTP_FILEFAIL, "Failed to open file.");
d7fdbd
+    if (kVSFSysUtilErrAGAIN == vsf_sysutil_get_error())
d7fdbd
+    {
d7fdbd
+      vsf_cmdio_write(p_sess, FTP_FILETMPFAIL, "Temporarily failed to open file");
d7fdbd
+    }
d7fdbd
+    else
d7fdbd
+    {
d7fdbd
+      vsf_cmdio_write(p_sess, FTP_FILEFAIL, "Failed to open file.");
d7fdbd
+    }
d7fdbd
     return;
d7fdbd
   }
d7fdbd
   /* Lock file if required */
d7fdbd
diff --git a/sysutil.c b/sysutil.c
d7fdbd
index 9881a66..6d7cb3f 100644
d7fdbd
--- a/sysutil.c
d7fdbd
+++ b/sysutil.c
d7fdbd
@@ -1632,6 +1632,9 @@ vsf_sysutil_get_error(void)
d7fdbd
     case ENOENT:
d7fdbd
       retval = kVSFSysUtilErrNOENT;
d7fdbd
       break;
d7fdbd
+    case EAGAIN:
d7fdbd
+      retval = kVSFSysUtilErrAGAIN;
d7fdbd
+      break;
d7fdbd
     default:
d7fdbd
       break;
d7fdbd
   }
d7fdbd
diff --git a/sysutil.h b/sysutil.h
d7fdbd
index 79b5514..c145bdf 100644
d7fdbd
--- a/sysutil.h
d7fdbd
+++ b/sysutil.h
d7fdbd
@@ -18,7 +18,8 @@ enum EVSFSysUtilError
d7fdbd
   kVSFSysUtilErrINVAL,
d7fdbd
   kVSFSysUtilErrOPNOTSUPP,
d7fdbd
   kVSFSysUtilErrACCES,
d7fdbd
-  kVSFSysUtilErrNOENT
d7fdbd
+  kVSFSysUtilErrNOENT,
d7fdbd
+  kVSFSysUtilErrAGAIN
d7fdbd
 };
d7fdbd
 enum EVSFSysUtilError vsf_sysutil_get_error(void);
d7fdbd
 
d7fdbd
-- 
d7fdbd
2.14.4
d7fdbd