nixpkgs/pkgs/os-specific/linux/qemu-kvm/smb-tmpdir.patch
Eelco Dolstra b22880b12d * qemu-kvm: increase the size of the buffer used to build the smbd
command line.

svn path=/nixpkgs/trunk/; revision=19756
2010-02-01 18:11:53 +00:00

34 lines
1.2 KiB
Diff

Honour $TMPDIR for the qemu-smb temporary directory.
diff -rc -x '*~' qemu-kvm-0.12.2-orig/net/slirp.c qemu-kvm-0.12.2/net/slirp.c
*** qemu-kvm-0.12.2-orig/net/slirp.c 2010-02-01 19:05:24.000000000 +0100
--- qemu-kvm-0.12.2/net/slirp.c 2010-02-01 19:05:54.000000000 +0100
***************
*** 476,486 ****
struct in_addr vserver_addr)
{
static int instance;
! char smb_conf[128];
! char smb_cmdline[128];
FILE *f;
! snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d",
(long)getpid(), instance++);
if (mkdir(s->smb_dir, 0700) < 0) {
qemu_error("could not create samba server dir '%s'\n", s->smb_dir);
--- 476,489 ----
struct in_addr vserver_addr)
{
static int instance;
! char smb_conf[1024];
! char smb_cmdline[1024];
FILE *f;
! char *tmpdir = getenv("TMPDIR");
!
! snprintf(s->smb_dir, sizeof(s->smb_dir), "%s/qemu-smb.%ld-%d",
! tmpdir ? tmpdir : "/tmp",
(long)getpid(), instance++);
if (mkdir(s->smb_dir, 0700) < 0) {
qemu_error("could not create samba server dir '%s'\n", s->smb_dir);