]> git.tuebingen.mpg.de Git - paraslash.git/commit
aft: Update mtime and file size on afhi changes.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 23 Dec 2014 12:52:03 +0000 (12:52 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Mar 2015 21:40:58 +0000 (21:40 +0000)
commit780f2f681bccf82024bdb6da2e2cccaa0e084663
treef2fb0b74f5bac9fc320d921e7ac3df97098fc45e
parentbb92402464a61c03616ff23397e753a9dca98d6d
aft: Update mtime and file size on afhi changes.

If the current audio file is re-added to the osl database, for example
because meta tags have changed, file size and modification time change.
However, the paraslash stat command still shows the old values because
currently the virtual streaming system calls fstat(2) only once when
the audio file is opened and keeps reporting the resulting mtime and
file size values until the file is closed.

This commit introduces make_inode_status_items() which is called
from make_status_items() on AFSI_CHANGE and AFHI_CHANGE events for
the current audio file. The new function calls stat(2) on the path
obtained from the current aft row. We can't use fstat(2) since (a)
we don't have an open file descriptor any more and (b) this would
not work anyway if the original file was overwritten.

Due to the new helper, mmd->mtime can be removed. We must keep
mmd->size though, since we need the original file size for the call
to munmap().
aft.c
command.c
server.h
vss.c