summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-12-09 11:53:45 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-12-09 11:53:45 +1100
commitbd11ec4faa0517cfbd5829012682e05be17e77d6 (patch)
treef37ebd7d41b4294fd2f37add5a90381cd734f545 /source3
parent18530985ec301b117096d7548108db827e4999d1 (diff)
parent3609c7433d17d78aceb1806340f53f7a2e23c9e8 (diff)
downloadsamba-bd11ec4faa0517cfbd5829012682e05be17e77d6.tar.gz
samba-bd11ec4faa0517cfbd5829012682e05be17e77d6.tar.bz2
samba-bd11ec4faa0517cfbd5829012682e05be17e77d6.zip
Merge commit 'origin/master' into abartlet-devel
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/system.c8
-rw-r--r--source3/modules/vfs_default.c25
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c2
3 files changed, 16 insertions, 19 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index a2dd89982e..a58d9037a7 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -621,16 +621,16 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
/*******************************************************************
An posix_fallocate() wrapper that will deal with 64 bit filesizes.
********************************************************************/
-#if (defined(HAVE_POSIX_FALLOCATE64) || defined(HAVE_POSIX_FALLOCATE)) && !defined(HAVE_BROKEN_POSIX_FALLOCATE)
int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len)
{
-#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_POSIX_FALLOCATE64)
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_POSIX_FALLOCATE64) && !defined(HAVE_BROKEN_POSIX_FALLOCATE)
return posix_fallocate64(fd, offset, len);
-#else
+#elif defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_BROKEN_POSIX_FALLOCATE)
return posix_fallocate(fd, offset, len);
+#else
+ return ENOSYS;
#endif
}
-#endif
/*******************************************************************
An ftruncate() wrapper that will deal with 64 bit filesizes.
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 9b842df93f..ded4b1af27 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -917,6 +917,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
SMB_OFF_T space_to_write;
uint64_t space_avail;
uint64_t bsize,dfree,dsize;
+ int ret;
if (currpos == -1)
return -1;
@@ -943,21 +944,17 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
emulation is being done by the libc (like on AIX with JFS1). In that
case we do our own emulation. posix_fallocate implementations can
return ENOTSUP or EINVAL in cases like that. */
-#if defined(HAVE_POSIX_FALLOCATE)
- {
- int ret = sys_posix_fallocate(fsp->fh->fd, st.st_ex_size, space_to_write);
- if (ret == ENOSPC) {
- errno = ENOSPC;
- return -1;
- }
- if (ret == 0) {
- return 0;
- }
- DEBUG(10,("strict_allocate_ftruncate: sys_posix_fallocate "
- "failed with error %d. "
- "Falling back to slow manual allocation\n", ret));
+ ret = sys_posix_fallocate(fsp->fh->fd, st.st_ex_size, space_to_write);
+ if (ret == ENOSPC) {
+ errno = ENOSPC;
+ return -1;
}
-#endif
+ if (ret == 0) {
+ return 0;
+ }
+ DEBUG(10,("strict_allocate_ftruncate: sys_posix_fallocate failed with "
+ "error %d. Falling back to slow manual allocation\n", ret));
+
/* available disk space is enough or not? */
space_avail = get_dfree_info(fsp->conn,
fsp->fsp_name->base_name, false,
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 9abed16ed9..1e66c7c021 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6461,7 +6461,7 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
uint32_t a,i;
WERROR result = WERR_OK;
- if (strequal(architecture, "all")) {
+ if (strequal(architecture, SPOOLSS_ARCHITECTURE_ALL)) {
for (a=0; archi_table[a].long_archi != NULL; a++) {