aboutsummaryrefslogtreecommitdiffstats
path: root/set_error_one_file.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-04-12 22:32:50 +0200
committerMattias Andrée <maandree@kth.se>2019-04-12 22:32:50 +0200
commit658557736a803071a47bacb33e8471168e67e6be (patch)
treea3d048c7e0ac825bb2a3906de2107becdfa3a6c6 /set_error_one_file.c
parentUse C99 rather than C11 (diff)
downloadliberror-libc-658557736a803071a47bacb33e8471168e67e6be.tar.gz
liberror-libc-658557736a803071a47bacb33e8471168e67e6be.tar.bz2
liberror-libc-658557736a803071a47bacb33e8471168e67e6be.tar.xz
shutdown: add name parameter
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'set_error_one_file.c')
-rw-r--r--set_error_one_file.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/set_error_one_file.c b/set_error_one_file.c
new file mode 100644
index 0000000..f8061f8
--- /dev/null
+++ b/set_error_one_file.c
@@ -0,0 +1,17 @@
+/* See LICENSE file for copyright and license details. */
+#include "internal.h"
+
+
+void
+liberror_libc_set_error_one_file(const char desc[256], const char source[64], const char *frole, int fd, const char *fname)
+{
+ struct liberror_error *error;
+ int saved_errno = errno;
+ liberror_set_error_errno(desc, source, saved_errno);
+ error = liberror_get_error();
+ error->details_type = LIBERROR_DETAILS_ONE_FILE;
+ error->details.one_file.fd = fd;
+ error->details.one_file.name = fname ? strdup(fname) : NULL;
+ error->details.one_file.role = frole;
+ errno = saved_errno;
+}