- fix seg. faults on amd64 due to many

vararg libXt calls (XtVa...) being terminated with 0 instead of with NULL.

from nima hoda, thanks!
This commit is contained in:
jasper 2010-01-03 21:49:06 +00:00
parent 667cc8fd1b
commit 2cdf4e833e
10 changed files with 370 additions and 14 deletions

View File

@ -1,14 +1,14 @@
# $OpenBSD: Makefile,v 1.21 2008/02/02 09:18:54 steven Exp $
# $OpenBSD: Makefile,v 1.22 2010/01/03 21:49:06 jasper Exp $
COMMENT= X11 File Manager
DISTNAME= xfm-1.4.3
PKGNAME= ${DISTNAME}p1
PKGNAME= ${DISTNAME}p2
CATEGORIES= x11
HOMEPAGE= http://www.musikwissenschaft.uni-mainz.de/~ag/xfm/
# GPL
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes

View File

@ -0,0 +1,29 @@
--- src/FmBitmaps.c.orig Wed Oct 29 07:02:05 1997
+++ src/FmBitmaps.c Sun Jan 3 01:03:08 2010
@@ -489,7 +489,7 @@
top=wid;
while(wtmp=XtParent(top)) top=wtmp;
- XtVaGetValues(top,XtNcolormap,&old,0);
+ XtVaGetValues(top,XtNcolormap,&old,NULL);
if (0==(new=XCopyColormapAndFree(di,old))) {
XtAppWarning(app,"switchColormap failed: cannot allocate new colormap");
@@ -497,7 +497,7 @@
}
has_private_cm=True;
- XtVaSetValues(top,XtNcolormap,new,0);
+ XtVaSetValues(top,XtNcolormap,new,NULL);
XtSetWMColormapWindows(top,&top,1);
XtAppWarning(app,"switching to private colormap...");
@@ -515,7 +515,7 @@
if (rval==XpmColorFailed && switchColormap(top)) {
/* get the new colormap */
- XtVaGetValues(top,XtNcolormap,&atts->colormap,0);
+ XtVaGetValues(top,XtNcolormap,&atts->colormap,NULL);
/* and repeat */
rval=(from_file? XpmReadFileToPixmap(dpy,win,(String)data,pm,msk,atts) :
XpmCreatePixmapFromData(dpy,win,data,pm,msk,atts));

View File

@ -0,0 +1,38 @@
--- src/FmChmod.c.orig Thu Aug 23 08:45:26 2001
+++ src/FmChmod.c Sun Jan 3 01:03:08 2010
@@ -160,7 +160,7 @@
case 2: picts=bm[SUID_BM]; break; case 3: picts=bm[sUID_BM]; break;
}
chmode.items[0][2].value=j;
- XtVaSetValues(chmode.items[0][2].w, XtNbitmap, picts, 0);
+ XtVaSetValues(chmode.items[0][2].w, XtNbitmap, picts, NULL);
j=(chmode.items[1][2].value & S_IXGRP ? 1:0);
j+=(chmode.items[1][2].value & S_ISGID ? 2:0);
@@ -168,7 +168,7 @@
case 2: picts=bm[SUID_BM]; break; case 3: picts=bm[sUID_BM]; break;
}
chmode.items[1][2].value=j;
- XtVaSetValues(chmode.items[1][2].w, XtNbitmap, picts, 0);
+ XtVaSetValues(chmode.items[1][2].w, XtNbitmap, picts, NULL);
j=(chmode.items[2][2].value & S_IXOTH ? 1:0);
j+=(chmode.items[2][2].value & S_ISVTX ? 2:0);
@@ -176,7 +176,7 @@
case 2: picts=bm[STICKY_BM]; break; case 3: picts=bm[StICKY_BM]; break;
}
chmode.items[2][2].value=j;
- XtVaSetValues(chmode.items[2][2].w, XtNbitmap, picts, 0);
+ XtVaSetValues(chmode.items[2][2].w, XtNbitmap, picts, NULL);
#else
for (i=0; i<3; i++) {
for (j=0; j<3; j++) {
@@ -231,7 +231,7 @@
switch(k) { case 0: picts=bm[NOTICK_BM]; break; case 1: picts=bm[TICK_BM]; break;
case 2: picts=bm[STICKY_BM]; break; case 3: picts=bm[StICKY_BM]; break;
}
- XtVaSetValues(chmode.items[i][j].w, XtNbitmap, picts, 0);
+ XtVaSetValues(chmode.items[i][j].w, XtNbitmap, picts, NULL);
}
#endif
}

View File

@ -1,7 +1,6 @@
$OpenBSD: patch-src_FmFw_c,v 1.1 2002/12/30 09:15:26 pvalchev Exp $
--- src/FmFw.c.orig Mon Dec 30 00:55:35 2002
+++ src/FmFw.c Mon Dec 30 00:56:08 2002
@@ -754,9 +754,9 @@ static int devAction(int d, char *action
--- src/FmFw.c.orig Thu Aug 23 08:45:26 2001
+++ src/FmFw.c Sun Jan 3 01:03:08 2010
@@ -754,9 +754,9 @@
fprintf(stderr, "%s\n", action);
freopen("/dev/null", "r", stdin);
if (user.arg0flag)
@ -13,3 +12,34 @@ $OpenBSD: patch-src_FmFw_c,v 1.1 2002/12/30 09:15:26 pvalchev Exp $
perror("Exec failed");
exit(1);
} else if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status) ||
@@ -797,7 +797,7 @@
XtAddCallback(fw->icon_box,XtNcallback,fileListCb,(XtPointer)fw);
- XtVaGetValues(fw->icon_box,XtNnHoriz,&nhoriz,0);
+ XtVaGetValues(fw->icon_box,XtNnHoriz,&nhoriz,NULL);
XtVaSetValues(fw->viewport, XtNallowHoriz, nhoriz!=0 , NULL);
}
@@ -1030,10 +1030,10 @@
}
#ifdef VIEWPORT_HACK
XawFormDoLayout(fw->icon_box,False);
- XtVaGetValues(fw->icon_box,XtNchildren,&children,XtNnumChildren,&num_children,0);
+ XtVaGetValues(fw->icon_box,XtNchildren,&children,XtNnumChildren,&num_children,NULL);
XtManageChildren(children,num_children);
if (!force_bars)
- XtVaSetValues(fw->viewport,XtNforceBars,False,0);
+ XtVaSetValues(fw->viewport,XtNforceBars,False,NULL);
#endif
}
@@ -1349,7 +1349,7 @@
x=y=0;
if (fw->icon_box) {
if (keep_position)
- XtVaGetValues(fw->icon_box,XtNx,&x,XtNy,&y,0);
+ XtVaGetValues(fw->icon_box,XtNx,&x,XtNy,&y,NULL);
XtUnrealizeWidget(fw->icon_box);
XtDestroyWidget(fw->icon_box);
}

View File

@ -0,0 +1,119 @@
--- src/FmHistory.c.orig Mon Aug 18 05:35:01 1997
+++ src/FmHistory.c Sun Jan 3 01:03:08 2010
@@ -69,7 +69,7 @@
name?name:"fm_history",
simpleMenuWidgetClass,
parent,
- 0);
+ NULL);
/* does the menu have a label? */
XtSetArg(args[0],XtNlabel,&str);
@@ -80,7 +80,7 @@
if (str) XtVaSetValues(
XtNameToWidget(menu,"menuLabel"),
XtNfont,resources.bold_font,
- 0);
+ NULL);
nargs=0;
XtSetArg(args[nargs],XtNlineWidth,0); nargs++;
@@ -99,7 +99,7 @@
smeBSBObjectClass,
menu,
XtNfont,resources.menu_font,
- 0),
+ NULL),
XtNcallback,
HistoryCB,
(XtPointer)hl);
@@ -125,7 +125,7 @@
/* from now on insert entries immediately after the line */
XtVaSetValues(menu,
XtNinsertPosition,InsertAfterLine,
- 0);
+ NULL);
hl->menu=menu;
@@ -154,7 +154,7 @@
history_menu,
XtNchildren,&chlds,
XtNnumChildren,&num_children,
- 0);
+ NULL);
XtSetArg(arg,XtNlabel,&str);
@@ -193,7 +193,7 @@
smeBSBObjectClass,
history_menu,
XtNfont,resources.menu_font,
- 0),
+ NULL),
XtNcallback,
HistoryCB,
(XtPointer)hl);
@@ -214,7 +214,7 @@
history_menu,
XtNchildren,&chlds,
XtNnumChildren,&num_children,
- 0);
+ NULL);
XtSetArg(arg,XtNlabel,&str);
@@ -236,7 +236,7 @@
if (i-haslabel==1) XtVaSetValues(
chlds[i],
XtNlineWidth,0,
- 0);
+ NULL);
XtDestroyWidget(found);
return;
}
@@ -269,7 +269,7 @@
history_menu,
XtNchildren,&chlds,
XtNnumChildren,&num_children,
- 0);
+ NULL);
i=0;
while (!XtIsSubclass(chlds[i],smeLineObjectClass)) i++;
@@ -318,7 +318,7 @@
Widget cw=XtParent(w), *chlds;
Cardinal pos;
- XtVaGetValues(cw,XtNchildren,&chlds,0);
+ XtVaGetValues(cw,XtNchildren,&chlds,NULL);
pos=0;
while(!XtIsSubclass(chlds[pos],smeLineObjectClass)) pos++;
@@ -345,7 +345,7 @@
Boolean keep_position=True;
#endif
- XtVaGetValues(w, XtNlabel, &str, 0);
+ XtVaGetValues(w, XtNlabel, &str, NULL);
strcpy(path,str);
fnexpand(path);
@@ -447,7 +447,7 @@
hl->menu,
XtNchildren,&chlds,
XtNnumChildren,&num_children,
- 0);
+ NULL);
destroy=(WidgetList)XtMalloc(sizeof(Widget) *num_children);
n_dest=0;
@@ -478,7 +478,7 @@
}
}
- if (fixed<1) XtVaSetValues(chlds[line_i],XtNlineWidth,0,0);
+ if (fixed<1) XtVaSetValues(chlds[line_i],XtNlineWidth,0,NULL);
chlds=0; /* for safety */
for (i=0; i<n_dest; i++) XtDestroyWidget(destroy[i]);
XtFree((char*)destroy); destroy=0;

View File

@ -0,0 +1,93 @@
--- src/FmLog.c.orig Thu Aug 23 08:45:26 2001
+++ src/FmLog.c Sun Jan 3 01:03:08 2010
@@ -42,7 +42,7 @@
fprintf(orig_stderr,"\nread error %i in 'get_pipe_input()'\n",errno);
if (nbytes>0) {
- XtVaSetValues(ldp->text,XtNeditType,XawtextEdit,0);
+ XtVaSetValues(ldp->text,XtNeditType,XawtextEdit,NULL);
block.format=FMT8BIT;
block.length=nbytes;
block.ptr=buf;
@@ -56,9 +56,9 @@
XtVaSetValues(ldp->text,
XtNeditType,XawtextRead,
XtNinsertPosition,pos,
- 0);
+ NULL);
- XtVaGetValues(ldp->auto_flag,XtNstate,&auto_popup,0);
+ XtVaGetValues(ldp->auto_flag,XtNstate,&auto_popup,NULL);
if (auto_popup)
popupByCursor(ldp->shell,XtGrabNone);
}
@@ -69,8 +69,8 @@
{
Boolean flag;
Pixel bg=(Pixel)cld,fg;
-XtVaGetValues(w,XtNstate,&flag,XtNforeground,&fg,0);
-XtVaSetValues(w,XtNbackground,(flag?bg:fg),0);
+XtVaGetValues(w,XtNstate,&flag,XtNforeground,&fg,NULL);
+XtVaSetValues(w,XtNbackground,(flag?bg:fg),NULL);
}
static void hide_log_cb(Widget w, XtPointer cld, XtPointer cad)
@@ -84,11 +84,11 @@
Widget text=(Widget)cld;
XawTextBlock block;
- XtVaSetValues(text,XtNeditType,XawtextEdit,0);
+ XtVaSetValues(text,XtNeditType,XawtextEdit,NULL);
block.firstPos=0; block.length=0; block.ptr=0;
block.format=FMT8BIT;
XawTextReplace(text,0,pos,&block);
- XtVaSetValues(text,XtNeditType,XawtextRead,0);
+ XtVaSetValues(text,XtNeditType,XawtextRead,NULL);
pos=0;
}
@@ -149,7 +149,7 @@
"form", formWidgetClass, ldp->shell,
NULL);
- XtVaGetValues(form,XtNdefaultDistance,&vdist,0);
+ XtVaGetValues(form,XtNdefaultDistance,&vdist,NULL);
button_args[FONT].value=(XtArgVal)font;
@@ -184,7 +184,7 @@
button_args,N_BUTTON_ARGS);
XtAddCallback(cmd,XtNcallback,clear_log_cb,(XtPointer)ldp->text);
- XtVaGetValues(cmd,XtNheight,&h1, XtNborderWidth,&bw, 0);
+ XtVaGetValues(cmd,XtNheight,&h1, XtNborderWidth,&bw, NULL);
button_args[FROM_HORIZ].value=(XtArgVal)cmd;
cmd =XtVaCreateManagedWidget("Auto Popup", labelWidgetClass, form,
@@ -197,7 +197,7 @@
XtNbottom,XtChainTop,
XtNfont,font,
XtNheight,h1+2*bw,
- 0);
+ NULL);
button_args[FROM_HORIZ].value=(XtArgVal)cmd;
ldp->auto_flag =XtCreateManagedWidget(
@@ -208,7 +208,7 @@
XtVaGetValues(ldp->auto_flag,
XtNforeground,&fg,XtNbackground,&bg,XtNstate,&flag,
XtNheight,&h2,
- 0);
+ NULL);
vdist+=(h1-h2)/2;
@@ -216,7 +216,7 @@
XtNvertDistance,vdist,
XtNforeground,bg,
XtNbackground,(flag?fg:bg),
- 0);
+ NULL);
XtAddCallback(ldp->auto_flag,XtNcallback,update_tick_cb,(XtPointer)fg);

View File

@ -1,7 +1,6 @@
$OpenBSD: patch-src_FmMain_c,v 1.1 2002/12/30 09:15:26 pvalchev Exp $
--- src/FmMain.c.orig Mon Dec 30 00:55:17 2002
+++ src/FmMain.c Mon Dec 30 00:55:29 2002
@@ -353,7 +353,7 @@ int shell_test(UserInfo *ui)
--- src/FmMain.c.orig Thu Aug 23 08:45:26 2001
+++ src/FmMain.c Sun Jan 3 01:03:08 2010
@@ -353,7 +353,7 @@
perror("(child) Can't close pipe");
exit(1);
}
@ -10,3 +9,12 @@ $OpenBSD: patch-src_FmMain_c,v 1.1 2002/12/30 09:15:26 pvalchev Exp $
perror("Exec failed");
exit(1);
} else { /* parent; read and check the child's output */
@@ -655,7 +655,7 @@
/* create a dummy window to store the WM_COMMAND property */
XtVaSetValues(aw.shell,
XtNmappedWhenManaged,False,
- 0);
+ NULL);
}
/* still realize and set the WM properties. the WM needs
* a window around and kwm is even able to restart an app

View File

@ -0,0 +1,25 @@
--- src/FmSelection.c.orig Wed Sep 24 14:32:50 1997
+++ src/FmSelection.c Sun Jan 3 01:03:08 2010
@@ -45,7 +45,7 @@
XtVaSetValues(fw->status,
XtNbackground,saved_bg,
XtNforeground,saved_fg,
- 0);
+ NULL);
}
static Boolean ConvertSelection(
@@ -168,11 +168,11 @@
XtVaGetValues(fw->status,
XtNbackground,&saved_bg,
XtNforeground,&saved_fg,
- 0);
+ NULL);
XtVaSetValues(fw->status,
XtNbackground,resources.highlight_pixel,
XtNforeground,saved_bg,
- 0);
+ NULL);
selection_owner=fw;
} else {
unhighlight(fw);

View File

@ -0,0 +1,14 @@
--- src/TextField.c.orig Tue Apr 4 11:05:36 2000
+++ src/TextField.c Sun Jan 3 01:03:08 2010
@@ -3437,9 +3437,9 @@
/* need to copy it first */
strncpy(TF.buffer,TF.backup,TF.maxlen);
TF.buffer[TF.maxlen-1]=0;
- XtVaSetValues(w,XtNstring,TF.buffer,0);
+ XtVaSetValues(w,XtNstring,TF.buffer,NULL);
} else {
- XtVaSetValues(w,XtNstring,TF.backup,0);
+ XtVaSetValues(w,XtNstring,TF.backup,NULL);
}
TF.modified_by_user = False;

View File

@ -1,7 +1,7 @@
@comment $OpenBSD: PLIST,v 1.6 2004/09/15 19:26:34 espie Exp $
bin/xfm
@comment $OpenBSD: PLIST,v 1.7 2010/01/03 21:49:06 jasper Exp $
@bin bin/xfm
bin/xfm.install
bin/xfmtype
@bin bin/xfmtype
lib/X11/app-defaults/Xfm
lib/X11/xfm/
lib/X11/xfm/bitmaps/