simplify substitutions and prevent them from interfering with update-patches

fix build with clang
This commit is contained in:
espie 2017-05-04 13:55:32 +00:00
parent 86aedf0097
commit 4e9502a2a7
2 changed files with 25 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.34 2017/02/27 15:38:02 jca Exp $
# $OpenBSD: Makefile,v 1.35 2017/05/04 13:55:32 espie Exp $
COMMENT= Chinese(Big5) VT100 terminal emulator for X
@ -23,12 +23,10 @@ CONFIGURE_STYLE= gnu old
CONFIGURE_ARGS= --os=OpenBSD --no-menu
post-configure:
mv ${WRKSRC}/config.status ${WRKSRC}/config.status.orig
sed -e '/OPT_CRXVT_CFONT/s/=.*/=-taipei-ming-medium-r-normal--16-160-75-75-c-160-big5-0/' ${WRKSRC}/config.status.orig > ${WRKSRC}/config.status
sed -i.bak -e '/OPT_CRXVT_CFONT/s/=.*/=-taipei-ming-medium-r-normal--16-160-75-75-c-160-big5-0/' ${WRKSRC}/config.status
post-extract:
mv ${WRKSRC}/script/os_def/FreeBSD ${WRKSRC}/script/os_def/FreeBSD.orig
sed -e '/OS/s/=.*/=OpenBSD/' ${WRKSRC}/script/os_def/FreeBSD.orig > ${WRKSRC}/script/os_def/OpenBSD
sed -e '/OS/s/=.*/=OpenBSD/' ${WRKSRC}/script/os_def/FreeBSD > ${WRKSRC}/script/os_def/OpenBSD
NO_TEST= Yes

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-src_utmp_c,v 1.1 2017/05/04 13:55:32 espie Exp $
Index: src/utmp.c
--- src/utmp.c.orig
+++ src/utmp.c
@@ -54,6 +54,7 @@
#include <pwd.h>
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
#include <memory.h>
#include <signal.h>
@@ -172,7 +173,7 @@ int write_utmp(char *ttyname, struct utmp *u)
FILE *utmp;
if (no_utmp)
- return;
+ return -1;
if ((utmp = fopen(UTMP, "r+")) == NULL)
return -1;
utmp_pos = get_tslot(ttyname) * sizeof(struct utmp);