Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 2008 05:55:47 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185666 - head/lib/libarchive
Message-ID:  <200812060555.mB65tl76084341@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kientzle
Date: Sat Dec  6 05:55:46 2008
New Revision: 185666
URL: http://svn.freebsd.org/changeset/base/185666

Log:
  Minor portability:  Declare 'r' only within the conditional
  block where it's used; S_ISLNK is more portable than S_ISLINK.

Modified:
  head/lib/libarchive/archive_write_disk.c

Modified: head/lib/libarchive/archive_write_disk.c
==============================================================================
--- head/lib/libarchive/archive_write_disk.c	Sat Dec  6 05:53:05 2008	(r185665)
+++ head/lib/libarchive/archive_write_disk.c	Sat Dec  6 05:55:46 2008	(r185666)
@@ -518,7 +518,6 @@ write_data_block(struct archive_write_di
 {
 	ssize_t bytes_written = 0;
 	ssize_t block_size = 0, bytes_to_write;
-	int r;
 
 	if (a->filesize == 0 || a->fd < 0) {
 		archive_set_error(&a->archive, 0,
@@ -528,6 +527,7 @@ write_data_block(struct archive_write_di
 
 	if (a->flags & ARCHIVE_EXTRACT_SPARSE) {
 #if HAVE_STRUCT_STAT_ST_BLKSIZE
+		int r;
 		if ((r = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK)
 			return (r);
 		block_size = a->pst->st_blksize;
@@ -1752,7 +1752,7 @@ set_time(int fd, int mode, const char *n
 	(void)mtime_nsec; /* UNUSED */
 	times.actime = atime;
 	times.modtime = mtime;
-	if (S_ISLINK(mode))
+	if (S_ISLNK(mode))
 		return (ARCHIVE_OK);
 	return (utime(name, &times));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812060555.mB65tl76084341>