Merge lp:~gaul/percona-data-recovery-tool-for-innodb/fseek into lp:percona-data-recovery-tool-for-innodb

Proposed by Andrew Gaul
Status: Needs review
Proposed branch: lp:~gaul/percona-data-recovery-tool-for-innodb/fseek
Merge into: lp:percona-data-recovery-tool-for-innodb
Diff against target: 29 lines (+1/-10)
1 file modified
innochecksum.c (+1/-10)
To merge this branch: bzr merge lp:~gaul/percona-data-recovery-tool-for-innodb/fseek
Reviewer Review Type Date Requested Status
Percona developers Pending
Review via email: mp+119396@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

69. By Andrew Gaul <email address hidden>

Prefer fseek over fileno and lseek

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innochecksum.c'
2--- innochecksum.c 2012-08-13 11:41:46 +0000
3+++ innochecksum.c 2012-08-13 17:47:25 +0000
4@@ -46,7 +46,6 @@
5 int verbose= 0;
6 int debug= 0;
7 int c;
8- int fd;
9 fpos_t pos;
10
11 /* remove arguments */
12@@ -148,16 +147,8 @@
13 /* seek to the necessary position */
14 if (start_page)
15 {
16- fd= fileno(f);
17- if (!fd)
18- {
19- perror("unable to obtain file descriptor number");
20- return 1;
21- }
22-
23 offset= (off_t)start_page * (off_t)UNIV_PAGE_SIZE;
24-
25- if (lseek(fd, offset, SEEK_SET) != offset)
26+ if (fseek(f, offset, SEEK_SET) != 0)
27 {
28 perror("unable to seek to necessary offset");
29 return 1;

Subscribers

People subscribed via source and target branches