Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2002 22:58:24 -0700 (PDT)
From:      Patrick Thomas <root@utility.clubscholarship.com>
To:        <freebsd-questions@freebsd.org>
Subject:   how to apply a cut and paste patchfile
Message-ID:  <20020809225516.H58763-100000@utility.clubscholarship.com>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020809225516.H58763-100000>