Re: vdr 1.7.23: patch for handling symlinks in recordings directory as earlier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13.02.2012 12:54, Klaus Schmidinger wrote:
On 13.02.2012 12:27, Lucian Muresan wrote:
On 13.02.2012 12:00, Klaus Schmidinger wrote:
[...]
Now I looked a bit closer, and noticed that the "first" call to stat
is actually not to *stat*, but to *lstat* in vanilla vdr-1.7.23, so if
you remove the call to the second one, could it be that you're not
really cutting redundancy, maybe it actually makes a difference?

Now you got me ;-)
I had switched back to 'stat()' instead of 'lstat()' and forgotten to
reintroduce
the 'lstat()'. Therefore I saw two identical calls to stat().
With the first call being lstat(), the second call to stat() is of
course necessary
for the following S_ISDIR() check.

Sorry for the confusion, and thanks for clarifying this.
So now this whole code sequence looks like this:

----------------------------------------------------------------------------------------------

if (lstat(buffer, &st) == 0) {
int Link = 0;
if (S_ISLNK(st.st_mode)) {
if (LinkLevel > MAX_LINK_LEVEL) {
isyslog("max link level exceeded - not scanning %s", *buffer);
continue;
}
Link = 1;
if (stat(buffer, &st) != 0)
continue;
}

No problem at all, I'm glad it's now sorted out for the next developer version.

Lucian

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux