aboutsummaryrefslogblamecommitdiffstats
path: root/set_error_one_file.c
blob: 04fef3639093c6d030b254d193de9f1132dc888a (plain) (tree)
1
2
3
4
5
6
7
8
9




                                                         
                                                                                                                    


                                     
                                      







                                                                    
/* See LICENSE file for copyright and license details. */
#include "internal.h"


void
liberror_libc_set_error_one_file(const char *desc, const char *source, const char *frole, int fd, const char *fname)
{
	struct liberror_error *error;
	int saved_errno = errno;
	liberror_save_backtrace(NULL);
	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;
}