Re: Surprising use of basename in finish_log_named

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

 



On 04/01/2014 09:00 AM, Erwan Velu wrote:
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 ?

I don't think there's a good reason for that. So feel free to send in a (tested) patch :-)

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

We can make it PATH_MAX instead, not a big deal.

--
Jens Axboe

--
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