char *fn;
size_t pathlen;
+ srand (time(NULL));
fn = pa_sprintf_malloc("%s" PA_PATH_SEP "pulse-XXXXXXXXXXXX", pa_get_temp_dir());
pathlen = strlen(fn);
char *pa_get_runtime_dir(void) {
char *d, *k = NULL, *p = NULL, *t = NULL, *mid;
mode_t m;
+ int retry_count = 100;
/* The runtime directory shall contain dynamic data that needs NOT
* to be kept across reboots and is usually private to the user,
for (;;) {
/* OK, first let's check if the "runtime" symlink already exists */
+ /* FIXME: This is recovery routine for infinite waiting issue such as below situation.
+ * eg. 50f64052a5dbbe087c11dfac4effb63c-runtime -> /tmp/pulse-LDK8gTL6Dh9N
+ 50f64052a5dbbe087c11dfac4effb63c-runtime.tmp -> /tmp/pulse-cDM1bQhObZ7O */
+ if (retry_count-- == 0) {
+ pa_log_error ("retry is over....do cleanup");
+
+ /* Remove original file */
+ unlink (k);
+
+ /* Remove original.tmp file */
+ t = pa_sprintf_malloc("%s.tmp", k);
+ unlink (t);
+ pa_xfree(t);
+ t = NULL;
+ }
p = pa_readlink(k);
if (!p) {
pa_is_path_absolute(t))
return t;
- return "/tmp";
+ return "/tmp/pulseaudio";
}
int pa_open_cloexec(const char *fn, int flags, mode_t mode) {