lkml.org 
[lkml]   [2010]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf tools: using O_LARGEFILE to open perf data file - fix
On 02/03/2010 03:06 AM, Xiao Guangrong wrote:
> static void get_next_page(int cpu)
> {
> - off64_t save_seek;
> - off64_t ret;
> + s64 save_seek;
> + s64 ret;

Should be off_t (which is 64 bits with _FILE_OFFSET_BITS=64.)

>
> if (!cpu_data[cpu].page)
> return;
> @@ -298,9 +298,9 @@ static void get_next_page(int cpu)
> update_cpu_data_index(cpu);
>
> /* other parts of the code may expect the pointer to not move */
> - save_seek = lseek64(input_fd, 0, SEEK_CUR);
> + save_seek = lseek(input_fd, 0, SEEK_CUR);
>
> - ret = lseek64(input_fd, cpu_data[cpu].offset, SEEK_SET);
> + ret = lseek(input_fd, cpu_data[cpu].offset, SEEK_SET);
> if (ret < 0)
> die("failed to lseek");

Compare for equality against (off_t)-1 here.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2010-02-03 18:37    [W:0.210 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site