[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated (561b89324 -> 46225cc04)
From: |
gnunet |
Subject: |
[gnunet] branch master updated (561b89324 -> 46225cc04) |
Date: |
Tue, 26 Nov 2024 19:19:47 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a change to branch master
in repository gnunet.
from 561b89324 -remove broken link; Fixes #9335
new 12d2498ac -typo
new 46225cc04 -fix close error handling
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/lib/util/configuration.c | 2 +-
src/lib/util/disk.c | 41 ++++++++++++++++++++++++++++++-----------
2 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/src/lib/util/configuration.c b/src/lib/util/configuration.c
index ff6a9b0ff..9c4e120a4 100644
--- a/src/lib/util/configuration.c
+++ b/src/lib/util/configuration.c
@@ -618,7 +618,7 @@ handle_inline (struct GNUNET_CONFIGURATION_Handle *cfg,
"does not contain section '%s'.\n",
inline_path,
restrict_section);
- /* Inlined onfiguration is accessible but doesn't contain any values.
+ /* Inlined configuration is accessible but doesn't contain any values.
We treat this as if the inlined section was empty, and do not
consider it an error. */
fun_ret = GNUNET_OK;
diff --git a/src/lib/util/disk.c b/src/lib/util/disk.c
index 558003a25..4202d021a 100644
--- a/src/lib/util/disk.c
+++ b/src/lib/util/disk.c
@@ -370,19 +370,33 @@ GNUNET_DISK_file_backup (const char *fil)
#if HAVE_RENAMEAT2
{
int fd;
+
do
{
- GNUNET_snprintf (target, slen, "%s.%u~", fil, num++);
- fd = open (target, O_CREAT | O_EXCL,
+ GNUNET_snprintf (target,
+ slen,
+ "%s.%u~",
+ fil,
+ num++);
+ fd = open (target,
+ O_CREAT | O_EXCL,
translate_unix_perms (GNUNET_DISK_PERM_USER_WRITE));
} while (-1 == fd);
- if (0 != renameat2 (AT_FDCWD, fil, AT_FDCWD, target, RENAME_EXCHANGE))
+ if (0 != renameat2 (AT_FDCWD,
+ fil,
+ AT_FDCWD,
+ target,
+ RENAME_EXCHANGE))
{
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "renameat2", fil);
- close (fd);
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "renameat2",
+ fil);
+ GNUNET_break (0 ==
+ close (fd));
return NULL;
}
- close (fd);
+ GNUNET_break (0 ==
+ close (fd));
}
#else
do
@@ -672,7 +686,8 @@ GNUNET_DISK_fn_read (const char *fn,
return GNUNET_SYSERR;
ret = GNUNET_DISK_file_read (fh, result, len);
eno = errno;
- GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh));
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_DISK_file_close (fh));
errno = eno;
return ret;
}
@@ -1154,13 +1169,17 @@ GNUNET_DISK_file_copy (const char *src,
pos += len;
}
GNUNET_free (buf);
- GNUNET_DISK_file_close (in);
- GNUNET_DISK_file_close (out);
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_DISK_file_close (in));
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_DISK_file_close (out));
return GNUNET_OK;
FAIL:
GNUNET_free (buf);
- GNUNET_DISK_file_close (in);
- GNUNET_DISK_file_close (out);
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_DISK_file_close (in));
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_DISK_file_close (out));
return GNUNET_SYSERR;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] branch master updated (561b89324 -> 46225cc04),
gnunet <=