projects
/
debian
/
pax
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
actually apply patch that fixes Hurd FTBFS
[debian/pax]
/
tables.c
diff --git
a/tables.c
b/tables.c
index e428051c3dadcedb46fa8f7ce442618b3805daa2..0e75ea51e69579c2bf744e1df9cccd0a1c38bed5 100644
(file)
--- a/
tables.c
+++ b/
tables.c
@@
-55,6
+55,7
@@
static const char rcsid[] = "$OpenBSD: tables.c,v 1.25 2007/09/02 15:19:08 deraa
#include "pax.h"
#include "tables.h"
#include "extern.h"
#include "pax.h"
#include "tables.h"
#include "extern.h"
+#include "features.h"
/*
* Routines for controlling the contents of all the different databases pax
/*
* Routines for controlling the contents of all the different databases pax
@@
-1126,13
+1127,21
@@
void
add_dir(char *name, struct stat *psb, int frc_mode)
{
DIRDATA *dblk;
add_dir(char *name, struct stat *psb, int frc_mode)
{
DIRDATA *dblk;
+#if (_POSIX_C_SOURCE - 0) >= 200809L
+ char *rp = NULL;
+#else
char realname[MAXPATHLEN], *rp;
char realname[MAXPATHLEN], *rp;
+#endif
if (dirp == NULL)
return;
if (havechd && *name != '/') {
if (dirp == NULL)
return;
if (havechd && *name != '/') {
+#if (_POSIX_C_SOURCE - 0) >= 200809L
+ if ((rp = realpath(name, NULL)) == NULL) {
+#else
if ((rp = realpath(name, realname)) == NULL) {
if ((rp = realpath(name, realname)) == NULL) {
+#endif
paxwarn(1, "Cannot canonicalize %s", name);
return;
}
paxwarn(1, "Cannot canonicalize %s", name);
return;
}
@@
-1143,6
+1152,9
@@
add_dir(char *name, struct stat *psb, int frc_mode)
if (dblk == NULL) {
paxwarn(1, "Unable to store mode and times for created"
" directory: %s", name);
if (dblk == NULL) {
paxwarn(1, "Unable to store mode and times for created"
" directory: %s", name);
+#if (_POSIX_C_SOURCE - 0) >= 200809L
+ free(rp);
+#endif
return;
}
dirp = dblk;
return;
}
dirp = dblk;
@@
-1152,6
+1164,9
@@
add_dir(char *name, struct stat *psb, int frc_mode)
if ((dblk->name = strdup(name)) == NULL) {
paxwarn(1, "Unable to store mode and times for created"
" directory: %s", name);
if ((dblk->name = strdup(name)) == NULL) {
paxwarn(1, "Unable to store mode and times for created"
" directory: %s", name);
+#if (_POSIX_C_SOURCE - 0) >= 200809L
+ free(rp);
+#endif
return;
}
dblk->mode = psb->st_mode & 0xffff;
return;
}
dblk->mode = psb->st_mode & 0xffff;
@@
-1159,6
+1174,9
@@
add_dir(char *name, struct stat *psb, int frc_mode)
dblk->atime = psb->st_atime;
dblk->frc_mode = frc_mode;
++dircnt;
dblk->atime = psb->st_atime;
dblk->frc_mode = frc_mode;
++dircnt;
+#if (_POSIX_C_SOURCE - 0) >= 200809L
+ free(rp);
+#endif
}
/*
}
/*