dtsession/SmDB: error handling issues (CID 87778, 87926)
authorJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 22:54:55 +0000 (15:54 -0700)
committerJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 22:54:55 +0000 (15:54 -0700)
cde/programs/dtsession/SmDB.c

index 7fa5208f4364c9ffcd776c274494c5e2b281cd23..b6c0e9aafa7e4ef2ae803a288d3caaf0571e186d 100644 (file)
@@ -498,7 +498,8 @@ OpenOutputClientDB(char *fileName,
     /* Open fileName for writing. */
     if ((outputDB->xrmDBFile = fopen(fileName, "w")) == (FILE *)NULL)
     {
-       rename(outputDB->tmpDBFileName, fileName);
+        int rv;
+       rv = rename(outputDB->tmpDBFileName, fileName);
        XtFree(outputDB->xrmDBFileName);
        XtFree(outputDB->tmpDBFileName);
        XtFree((char *)outputDB);
@@ -705,9 +706,10 @@ CloseClientDB(ClientDB clientDBPtr, Boolean writeDB)
     }
     else
     {
+      int rv;
        /* Close file and remove it; restore original DB. */
        fclose(clientDB->xrmDBFile);
-       rename(clientDB->tmpDBFileName, clientDB->xrmDBFileName);
+       rv = rename(clientDB->tmpDBFileName, clientDB->xrmDBFileName);
     }
 
     XtFree(clientDB->xrmDBFileName);