Surprising use of basename in finish_log_named

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

 



Hi Jens,

I had a input of the fio irc channel (yes some at getting into it sometimes :p), and he had a very interesting point.

If you specify a full path name for the iops_log, the file will stay into the current dir. While looking at the code I found that finish_log_named() is performing the following:

    char file_name[256], *p;
    snprintf(file_name, sizeof(file_name), "%s_%s.log", prefix, postfix);
    p = basename(file_name);

Why do we basename the file_name ? What's the reason of shrinking the path this way ?

Note for the author: 256 is maybe too small for some ? :)))

Cheers,
Erwan
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux