changeset 699:9873d695a9c1

Do not use glib posix wrappers since they were introduced in 2.6 and we want 2.4 compatibility.
author zas_
date Tue, 20 May 2008 20:11:29 +0000
parents 2700db14aaa6
children b2eb4ff74d13
files src/secure_save.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/secure_save.c	Tue May 20 20:06:11 2008 +0000
+++ b/src/secure_save.c	Tue May 20 20:11:29 2008 +0000
@@ -94,9 +94,9 @@
 
 	/* Check properties of final file. */
 #ifndef NO_UNIX_SOFTLINKS
-	if (g_lstat(ssi->file_name, &st)) {
+	if (lstat(ssi->file_name, &st)) {
 #else
-	if (g_stat(ssi->file_name, &st)) {
+	if (stat(ssi->file_name, &st)) {
 #endif
 		/* We ignore error caused by file inexistence. */
 		if (errno != ENOENT) {
@@ -123,7 +123,7 @@
 			/* We still have a race condition here between
 			 * [l]stat() and fopen() */
 
-			f1 = g_fopen(ssi->file_name, "rb+");
+			f1 = fopen(ssi->file_name, "rb+");
 			if (f1) {
 				fclose(f1);
 			} else {
@@ -167,7 +167,7 @@
 		ssi->tmp_file_name = randname;
 	} else {
 		/* No need to create a temporary file here. */
-		ssi->fp = g_fopen(ssi->file_name, "wb");
+		ssi->fp = fopen(ssi->file_name, "wb");
 		if (!ssi->fp) {
 			secsave_errno = SS_ERR_OPEN_WRITE;
 			ssi->err = errno;
@@ -267,9 +267,9 @@
 		 * secure_open() call (where we stat() file and
 		 * more..).  */
 #ifndef NO_UNIX_SOFTLINKS
-		if (g_lstat(ssi->file_name, &st) == 0)
+		if (lstat(ssi->file_name, &st) == 0)
 #else
-		if (g_stat(ssi->file_name, &st) == 0)
+		if (stat(ssi->file_name, &st) == 0)
 #endif
 			{
 			/* set the dest file attributes to that of source (ignoring errors) */
@@ -289,7 +289,7 @@
 				}
 			}
 		DEBUG_3("rename %s -> %s", ssi->tmp_file_name, ssi->file_name);
-		if (g_rename(ssi->tmp_file_name, ssi->file_name) == -1) {
+		if (rename(ssi->tmp_file_name, ssi->file_name) == -1) {
 			ret = errno;
 			secsave_errno = SS_ERR_RENAME;
 			goto free;