From 047f92a85796fca563d9345d6c4798b64be77cff Mon Sep 17 00:00:00 2001
From: "Dr. Tilmann Bubeck" <tilmann@bubecks.de>
Date: Tue, 24 Jun 2014 00:22:54 +0200
Subject: [PATCH 1/4] Fix for xauth failing on ENOSPC (= disk full)

If xauth must store its XAUTHORITY file on a file system which is
full, it will be unable to write the changes. This condition was
not detected and therefore often the whole XAUTHORITY file was
cleared. Here is the fix.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=21260

Signed-off-by: Dr. Tilmann Bubeck <tilmann@bubecks.de>
---
 process.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/process.c b/process.c
index b44858a..5b12c92 100644
--- a/process.c
+++ b/process.c
@@ -844,7 +844,10 @@ write_auth_file(char *tmp_nam)
 	}
     }
 
-    (void) fclose (fp);
+    if (fclose(fp)) {
+	return -1;
+    }
+
     return 0;
 }
 
-- 
2.3.0

