Bug #801

bug in cvs using diff -p

Added by vs1 about 9 years ago. Updated about 9 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Hi Matt.

I ended up manually patching this. It failed every time, using patch.
Luckily, in this case, it was just a simple 1 liner.

I finally tracked down the problem. I noticed you used cvs to create
the patch.

It is apparently a bug with cvs 1.12.13 on Dragonfly. I tested with cvs
1.11.20 on NetBSD and it worked properly, so it is apparently a bug cvs
has introduced in the newer version.

When using the -p option to diff when running under cvs, it outputs
a broken patch file. The problem is that it outputs the previous line
at the end of the '@@' line rather than the function name.

# cvs diff -u -p md.c
Index: md.c
RCS file: /home/dcvs/src/sys/dev/disk/md/md.c,v
retrieving revision
diff -u -p -r1.16.2.1 md.c
--- md.c 31 Jul 2007 22:40:49 -0000
+++ md.c 4 Sep 2007 06:36:37 -0000
sc->dev = disk_create(sc->unit, &sc->disk, &md_ops);
sc->dev->si_drv1 = sc;
+ sc->dev->si_iosize_max = DFLTPHYS;
return (sc);


It worked properly with the same options using diff directly.
The output should look like this.

# diff -u -p md.c md.c-manually_patched

--- md.c 2007-09-04 01:30:23.000000000 -0500
+++ md.c-manually_patched 2007-09-04 01:20:44.000000000 -0500
@@ -373,6 +373,8 @@ mdcreate(void)
sc->dev = disk_create(sc->unit, &sc->disk, &md_ops);
sc->dev->si_drv1 = sc;
+ sc->dev->si_iosize_max = DFLTPHYS;
return (sc);


Notice it shows the "mdcreate(void)" function at the end of the "@@"

I noticed, on the cvs site, that 1.12.13 is not in the stable tree. You
might want to consider downgrading it to version 1.11.22 on Dragonfly,
which is the latest one I see in the stable branch.



#1 Updated by qhwt+dfly about 9 years ago

JFYI, this works properly on DragonFly 1.8-RELEASE, or with cvs-1.12.13
installed from source on CentOS-4.5. So it must be more recent changes
that's causing it.


#2 Updated by corecode about 9 years ago

I could reproduce it also in 1.8.1, so there must be some other cause.
Maybe it worked in 1.6. If you are absolutely sure that it works with
your 1.8, then it must be the compiler optimization, or just pure luck.

Anyways, it's fixed now.


Also available in: Atom PDF