/*
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
* Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
* All Rights Reserved.
*
* Permission to use, copy, modify, distribute, and sell this software and its
/* start the sort process */
putenv(stralloc("LC_ALL=C"));
- pid_sort = pipespawn(SORT_PATH, STDIN_PIPE|STDERR_PIPE, 0,
- &pipe_to_sort, &indexfd, &sort_errfd,
- SORT_PATH, NULL);
+ if (getconf_seen(CNF_TMPDIR)) {
+ gchar *tmpdir = getconf_str(CNF_TMPDIR);
+ pid_sort = pipespawn(SORT_PATH, STDIN_PIPE|STDERR_PIPE, 0,
+ &pipe_to_sort, &indexfd, &sort_errfd,
+ SORT_PATH, "-T", tmpdir, NULL);
+ } else {
+ pid_sort = pipespawn(SORT_PATH, STDIN_PIPE|STDERR_PIPE, 0,
+ &pipe_to_sort, &indexfd, &sort_errfd,
+ SORT_PATH, NULL);
+ }
aclose(indexfd);
/* start a subprocess */
char his_hostname[MAX_HOSTNAME_LENGTH];
char *cfg_opt = NULL;
+ if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) {
+ printf("amindexd-%s\n", VERSION);
+ return (0);
+ }
+
/*
* Configure program for internationalization:
* 1) Only set the message locale for now.