aboutsummaryrefslogtreecommitdiff
path: root/src/main/extractor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/extractor.c')
-rw-r--r--src/main/extractor.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/main/extractor.c b/src/main/extractor.c
index 427de3b..6ec15e1 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -1486,14 +1486,22 @@ make_shm (int is_tail,
1486 size_t fn_size, 1486 size_t fn_size,
1487 size_t size) 1487 size_t size)
1488{ 1488{
1489 snprintf (fn, 1489 const char *tpath;
1490 fn_size, 1490
1491#ifdef WINDOWS 1491#ifdef WINDOWS
1492 "%TEMP%\\" 1492 tpath = "%TEMP%\\";
1493#elif SOMEBSD
1494 /* this works on FreeBSD, not sure about others... */
1495 tpath = getenv ("TMPDIR");
1496 if (tpath == NULL)
1497 tpath = "/tmp/";
1493#else 1498#else
1494 "/" 1499 tpath = "/"; /* Linux */
1495#endif 1500#endif
1496 "libextractor-%sshm-%u-%u", 1501 snprintf (fn,
1502 fn_size,
1503 "%slibextractor-%sshm-%u-%u",
1504 tpath,
1497 (is_tail) ? "t" : "", 1505 (is_tail) ? "t" : "",
1498 getpid(), 1506 getpid(),
1499 (unsigned int) RANDOM()); 1507 (unsigned int) RANDOM());