summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch
blob: 809e54e9cb882a9b0652137f4ed09807f5a5c560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
rpmdb: more verbose error logging in rpmTempFile()

Upstream-Status: Inappropriate [debugging]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>

diff --git a/rpmdb/signature.c b/rpmdb/signature.c
index dce6c4e..a1d0f06 100644
--- a/rpmdb/signature.c
+++ b/rpmdb/signature.c
@@ -37,6 +37,7 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
     int temput;
     FD_t fd = NULL;
     unsigned int ran;
+    int ret = 0;
 
     if (!prefix) prefix = "";
 
@@ -44,8 +45,11 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
     if (!_initialized) {
 	_initialized = 1;
 	tempfn = rpmGenPath(prefix, tpmacro, NULL);
-	if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1))
-	    goto errxit;
+        ret = rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1);
+        if (ret) {
+            rpmlog(RPMLOG_ERR, _("error creating temporary directory %s: %d\n"), tempfn, ret);
+            goto errxit;
+        }
     }
 
     /* XXX should probably use mkstemp here */
@@ -68,12 +72,16 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
 #endif
 
 	temput = urlPath(tempfn, &tfn);
-	if (*tfn == '\0') goto errxit;
+	if (*tfn == '\0') {
+            rpmlog(RPMLOG_ERR, _("error creating tempfile: empty filename\n"));
+            goto errxit;
+        }
 
 	switch (temput) {
 	case URL_IS_DASH:
 	case URL_IS_HKP:
 	case URL_IS_MONGO:	/* XXX FIXME */
+            rpmlog(RPMLOG_ERR, _("error creating temporary file, invalid uri type: %d\n"), temput);
 	    goto errxit;
 	    /*@notreached@*/ /*@switchbreak@*/ break;
 	case URL_IS_HTTPS:
-- 
2.6.6