1
0
Fork 0

Merging upstream version 4.3+20240723.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-14 06:34:47 +01:00
parent 9d4f96bc70
commit aa881a3626
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
70 changed files with 1465 additions and 1206 deletions

11
Dump.c
View file

@ -37,6 +37,7 @@ int Dump_metadata(char *dev, char *dir, struct context *c,
unsigned long long size;
DIR *dirp;
struct dirent *de;
int ret = 0;
if (stat(dir, &stb) != 0 ||
(S_IFMT & stb.st_mode) != S_IFDIR) {
@ -112,9 +113,15 @@ int Dump_metadata(char *dev, char *dir, struct context *c,
}
if (c->verbose >= 0)
printf("%s saved as %s.\n", dev, fname);
fstat(fd, &dstb);
close(fd);
close(fl);
ret = fstat(fd, &dstb);
close(fd);
if (ret) {
unlink(fname);
free(fname);
return 1;
}
if ((dstb.st_mode & S_IFMT) != S_IFBLK) {
/* Not a block device, so cannot create links */
free(fname);