]> git.lizzy.rs Git - plan9front.git/commitdiff
doom: clean up temporary mus files
authorqwx <devnull@localhost>
Thu, 10 Aug 2017 15:09:49 +0000 (17:09 +0200)
committerqwx <devnull@localhost>
Thu, 10 Aug 2017 15:09:49 +0000 (17:09 +0200)
sys/src/games/doom/i_sound.c

index 1eae9083882b5a9c0d8c669f8e39817b6232df95..aff0a3433d7b9253e54a4f4077d7153f4a1f4966 100644 (file)
@@ -463,8 +463,8 @@ void I_PlaySong(musicinfo_t *m, int loop)
                dup(mpfd[1], 1);
                for(n=3; n<20; n++) close(n);
                close(0);
-               snprint(name, sizeof(name), "/tmp/%s.mus", m->name);
-               if(create(name, ORDWR, 0666) != 0)
+               snprint(name, sizeof(name), "/tmp/doom.%d", getpid());
+               if(create(name, ORDWR|ORCLOSE, 0666) != 0)
                        sysfatal("create: %r");
                n = W_LumpLength(m->lumpnum);
                if(write(0, m->data, n) != n)