Honor $TMPDIR like g_get_tmp_dir()
authorRicardo Mones <ricardo@mones.org>
Thu, 6 Nov 2014 13:16:06 +0000 (14:16 +0100)
committerRicardo Mones <ricardo@mones.org>
Thu, 6 Nov 2014 13:16:06 +0000 (14:16 +0100)
clawsker

index 04c1995376f6eb40fc600a6f3fac2bb57559dd4c..5b20714bcc9bbf7650c56409670a86275123df2d 100755 (executable)
--- a/clawsker
+++ b/clawsker
@@ -375,11 +375,13 @@ sub claws_is_running {
 }
 
 sub check_claws_not_running {
 }
 
 sub check_claws_not_running {
-    my $socket = (not $ALTCONFIGDIR)? "/tmp/": $CONFIGDIR;
-    $socket .= "claws-mail-$<";
+    my $tmpdir = (defined $ENV{TMPDIR})? $ENV{TMPDIR}: '/tmp';
+    $tmpdir = '/tmp' if ($tmpdir eq '');
+    my $socket = (not $ALTCONFIGDIR)? $tmpdir: $CONFIGDIR;
+    $socket .= "/claws-mail-$<";
     -S $socket and return claws_is_running ();
     # since 3.9.0cvs36
     -S $socket and return claws_is_running ();
     # since 3.9.0cvs36
-    my $lockdir = "/tmp/claws-mail-$<";
+    my $lockdir = "$tmpdir/claws-mail-$<";
     -d $lockdir and do { 
        $_ = $CONFIGDIR;
        s/\/$//;
     -d $lockdir and do { 
        $_ = $CONFIGDIR;
        s/\/$//;