From owner-freebsd-questions Fri Aug 9 22:59: 8 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B25E37B400 for ; Fri, 9 Aug 2002 22:59:06 -0700 (PDT) Received: from utility.clubscholarship.com (utility.clubscholarship.com [198.78.70.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id E165C43E6A for ; Fri, 9 Aug 2002 22:59:05 -0700 (PDT) (envelope-from root@utility.clubscholarship.com) Received: from localhost (root@localhost) by utility.clubscholarship.com (8.11.6/8.11.6) with ESMTP id g7A5wOD59648 for ; Fri, 9 Aug 2002 22:58:24 -0700 (PDT) (envelope-from root@utility.clubscholarship.com) Date: Fri, 9 Aug 2002 22:58:24 -0700 (PDT) From: Patrick Thomas To: Subject: how to apply a cut and paste patchfile Message-ID: <20020809225516.H58763-100000@utility.clubscholarship.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, I have seen in a usenet posting a patch I would like to apply to /usr/src/sys/netinet/in_pcb.c As I say, the patch is in a news posting. So, I copied and pasted from the news posting into a file called: /usr/src/sys/netinet/patchfile My cut/paste looked just like this: --- in_pcb.c.old Mon Mar 18 23:57:57 2002 +++ in_pcb.c Tue Mar 19 09:52:45 2002 @@ -501,6 +501,8 @@ int error; if (inp->inp_laddr.s_addr == INADDR_ANY && p->p_prison != NULL) { + if (inp->inp_lport != 0) + inp->inp_laddr.s_addr = htonl(p->p_prison->pr_ip); bzero(&sa, sizeof (sa)); sa.sin_addr.s_addr = htonl(p->p_prison->pr_ip); sa.sin_len=sizeof (sa); then I saved the file, and while in the /usr/src/sys/netinet directory, I ran the command: patch < patchfile and I got this error: Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- in_pcb.c.old Mon Mar 18 23:57:57 2002 |+++ in_pcb.c Tue Mar 19 09:52:45 2002 -------------------------- Patching file in_pcb.c using Plan A... Hunk #1 failed at 501. 1 out of 1 hunks failed--saving rejects to in_pcb.c.rej done So ... what am I doing wrong ? Am I screwing up the patchfile when I copy/paste it and the tab indents turn into multiple space indents ? Or some other thing getting lost in the copy/paste translation ? Or am I doing something else wrong ? thanks, PT To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message