andrewrk / andrewrk/libsoundio

Learn about tmp directory from the TMPDIR environment variable

Offen
#128 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
C
Sterne
2.1k
Forks
254
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

In the OS abstraction layer, we have this code:

```
char shm_path[] = "/dev/shm/soundio-XXXXXX";
char tmp_path[] = "/tmp/soundio-XXXXXX";
char *chosen_path;

int fd = mkstemp(shm_path);
if (fd < 0) {
fd = mkstemp(tmp_path);
if (fd < 0) {
return SoundIoErrorSystemResources;
} else {
chosen_path = tmp_path;
}
} else {
chosen_path = shm_path;
}
```

I think the part with `/dev/shm/*` is OK, and even the fallback to `/tmp/*` is OK. But let's also check TMPDIR. So it would be 1) try /dev/shm 2) try TMPDIR 3) try /tmp/*.

This would simplify part of #127

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.