# [PATCH 01/13] Fix lseek(2) calls with args 2 and 3 swapped

2 messages from 2007-04-05 to 2007-04-05. Participants: Dana How, Junio C Hamano.
Thread: https://gitlist.dev/t/7530

## Dana How, 2007-04-05 22:23

Subject: [PATCH 01/13] Fix lseek(2) calls with args 2 and 3 swapped
Message-ID: <56b7f5510704051523l30c422c6ie2ba561577fecb73@mail.gmail.com>
URL: https://gitlist.dev/e/56b7f5510704051523l30c422c6ie2ba561577fecb73%40mail.gmail.com

```
---
 http-fetch.c |    2 +-
 http-push.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell


From afaa3fa754d8abc296261275339ec50182983dd7 Mon Sep 17 00:00:00 2001
From: Dana How <how@deathvalley.cswitch.com>
Date: Thu, 5 Apr 2007 12:05:57 -0700
Subject: [PATCH 01/13] Fix lseek(2) calls with args 2 and 3 swapped

---
 http-fetch.c |    2 +-
 http-push.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/http-fetch.c b/http-fetch.c
index 557b403..09baedc 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -198,7 +198,7 @@ static void start_object_request(struct object_request *obj_req)
 		SHA1_Init(&obj_req->c);
 		if (prev_posn>0) {
 			prev_posn = 0;
-			lseek(obj_req->local, SEEK_SET, 0);
+			lseek(obj_req->local, 0, SEEK_SET);
 			ftruncate(obj_req->local, 0);
 		}
 	}
diff --git a/http-push.c b/http-push.c
index 724720c..e3f7675 100644
--- a/http-push.c
+++ b/http-push.c
@@ -312,7 +312,7 @@ static void start_fetch_loose(struct transfer_request *request)
 		SHA1_Init(&request->c);
 		if (prev_posn>0) {
 			prev_posn = 0;
-			lseek(request->local_fileno, SEEK_SET, 0);
+			lseek(request->local_fileno, 0, SEEK_SET);
 			ftruncate(request->local_fileno, 0);
 		}
 	}
-- 
1.5.1.rc2.18.g9c88-dirty


```

## Junio C Hamano, 2007-04-05 23:00

Subject: Re: [PATCH 01/13] Fix lseek(2) calls with args 2 and 3 swapped
Message-ID: <7vd52imnpa.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd52imnpa.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <56b7f5510704051523l30c422c6ie2ba561577fecb73@mail.gmail.com>

```
Good fixes. Thanks.

Although I suspect they are no-op in practice (SEEK_SET is
probably zero anyway).  Will apply to 'maint' to be included in
v1.5.1.1.

```
