summaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/data.c b/src/data.c
index d8768b9..6525f56 100644
--- a/src/data.c
+++ b/src/data.c
@@ -490,6 +490,9 @@ track_rm(struct track *track, bool sync_fs)
/* remove from player queue */
link_pop(&track->link_pq);
+ /* remove from player history */
+ link_pop(&track->link_hs);
+
/* remove the reference as last used track */
if (player.track == track)
player.track = NULL;
@@ -517,8 +520,8 @@ aquire_lock(const char *datadir)
return false;
}
- fread(linebuf, 1, sizeof(linebuf), file);
- pid = atoi(linebuf);
+ fgets(linebuf, sizeof(linebuf), file);
+ pid = strtol(linebuf, NULL, 10);
procpath = aprintf("/proc/%i", pid);
OOM_CHECK(procpath);
if (path_exists(procpath)) {