summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-09-14 01:07:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:45 -0500
commitdd16ae2506abe46093118e2a33d9d0cae6455d07 (patch)
treeb99e38c9e4c45edf88eb2b1ab66c05ce8628ea04 /source3
parent34991bbd0c5d5f85cdbaf7d847ea1570235c29f7 (diff)
downloadsamba-dd16ae2506abe46093118e2a33d9d0cae6455d07.tar.gz
samba-dd16ae2506abe46093118e2a33d9d0cae6455d07.tar.bz2
samba-dd16ae2506abe46093118e2a33d9d0cae6455d07.zip
r25141: More pstring removal.
Jeremy. (This used to be commit cfcf7cf03e1be34e6839c1a659c4e8c1b5358c37)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/oplock_irix.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/oplock_irix.c b/source3/smbd/oplock_irix.c
index dde32fa288..9f81a960f5 100644
--- a/source3/smbd/oplock_irix.c
+++ b/source3/smbd/oplock_irix.c
@@ -33,17 +33,25 @@ static BOOL irix_oplocks_available(void)
{
int fd;
int pfd[2];
- pstring tmpname;
+ TALLOC_CTX *ctx = talloc_stackframe();
+ char *tmpname = NULL;
set_effective_capability(KERNEL_OPLOCK_CAPABILITY);
- slprintf(tmpname,sizeof(tmpname)-1, "%s/koplock.%d", lp_lockdir(),
- (int)sys_getpid());
+ tmpname = talloc_asprintf(ctx,
+ "%s/koplock.%d",
+ lp_lockdir(),
+ (int)sys_getpid());
+ if (!tmpname) {
+ TALLOC_FREE(ctx);
+ return False;
+ }
if(pipe(pfd) != 0) {
DEBUG(0,("check_kernel_oplocks: Unable to create pipe. Error "
"was %s\n",
strerror(errno) ));
+ TALLOC_FREE(ctx);
return False;
}
@@ -54,11 +62,14 @@ static BOOL irix_oplocks_available(void)
unlink( tmpname );
close(pfd[0]);
close(pfd[1]);
+ TALLOC_FREE(ctx);
return False;
}
unlink(tmpname);
+ TALLOC_FREE(ctx);
+
if(sys_fcntl_long(fd, F_OPLKREG, pfd[1]) == -1) {
DEBUG(0,("check_kernel_oplocks: Kernel oplocks are not "
"available on this machine. Disabling kernel oplock "