opnsense-ports/sysutils/radmind/files/patch-t2pkg.c
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

46 lines
1.4 KiB
C

--- ./t2pkg.c.orig 2010-12-13 04:42:49.000000000 +0100
+++ ./t2pkg.c 2014-06-29 12:15:04.248542975 +0200
@@ -38,6 +38,7 @@
extern off_t lsize;
extern char *version;
+int tran_format = -1;
int cksum = 0;
int force = 0;
int case_sensitive = 1;
@@ -718,31 +719,23 @@
}
/* create the destination path */
- if ( snprintf( tmp, MAXPATHLEN, "%s/%s", dstdir, t->t_pinfo.pi_name )
+ if ( snprintf( dst, MAXPATHLEN, "%s/%s", dstdir, t->t_pinfo.pi_name )
>= MAXPATHLEN ) {
fprintf( stderr, "%s/%s: path too long\n", dstdir,
t->t_pinfo.pi_name );
exit( 2 );
}
- if ( mkdirs( tmp ) < 0 ) {
- fprintf( stderr, "mkdirs %s: %s\n", tmp, strerror( errno ));
- }
- if ( realpath( tmp, dst ) == NULL ) {
- fprintf( stderr, "realpath %s: %s\n", tmp, strerror( errno ));
- exit( 2 );
+ if ( mkdirs( dst ) < 0 ) {
+ fprintf( stderr, "mkdirs %s: %s\n", dst, strerror( errno ));
}
/* and the source path */
- if ( snprintf( tmp, MAXPATHLEN, "%s/%s", root, t->t_pinfo.pi_name )
+ if ( snprintf( src, MAXPATHLEN, "%s/%s", root, t->t_pinfo.pi_name )
>= MAXPATHLEN ) {
fprintf( stderr, "%s/%s: path too long\n", dstdir,
t->t_pinfo.pi_name );
exit( 2 );
}
- if ( realpath( tmp, src ) == NULL ) {
- fprintf( stderr, "realpath %s: %s\n", tmp, strerror( errno ));
- exit( 2 );
- }
if ( local_update( t, dst, src, where ) != 0 ) {
/* XXX is this really a good idea? */