From owner-freebsd-current@FreeBSD.ORG Tue Nov 2 19:32:51 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD161065674 for ; Tue, 2 Nov 2010 19:32:51 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id B607A8FC14 for ; Tue, 2 Nov 2010 19:32:50 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 206492A28D05; Tue, 2 Nov 2010 20:32:50 +0100 (CET) Date: Tue, 2 Nov 2010 20:32:50 +0100 From: Ed Schouten To: Matthias Apitz Message-ID: <20101102193250.GU81149@hoeg.nl> References: <20101102061418.GA1884@current.Sisis.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AJd+a2ML6L6CXP6l" Content-Disposition: inline In-Reply-To: <20101102061418.GA1884@current.Sisis.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: kde-freebsd@kde.org, freebsd-current@freebsd.org Subject: Re: 9-CURRENT: ports/net/kdenetwork3 does not compile X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 19:32:51 -0000 --AJd+a2ML6L6CXP6l Content-Type: multipart/mixed; boundary="jtEtYGE75hrP1CgP" Content-Disposition: inline --jtEtYGE75hrP1CgP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello all, Just to notify everyone what's going on; Matthias tested a patch for me, which should make it work on HEAD again. The attached patch should be applied to the sources conditionally (so only when running HEAD). I am in the process of getting it fixed in ports/upstreamed. Greetings, --=20 Ed Schouten WWW: http://80386.nl/ --jtEtYGE75hrP1CgP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kdenetwork.txt" Content-Transfer-Encoding: quoted-printable --- ktalkd/ktalkd/find_user.cpp +++ ktalkd/ktalkd/find_user.cpp @@ -339,34 +339,33 @@ =20 #else /*not PROC_FIND_USER*/ =20 +#include + int find_user(char *name, char *tty, char *disp) { =20 - struct utmp ubuf; + struct utmpx *ubuf; int status; - FILE *fd; struct stat statb; - char ftty[20+UT_LINESIZE]; - char ttyFound[UT_LINESIZE] =3D ""; - char dispFound[UT_HOSTSIZE+1] =3D ""; - - if (!(fd =3D fopen(_PATH_UTMP, "r"))) { - fprintf(stderr, "talkd: can't read %s.\n", _PATH_UTMP); - return (FAILED); - } + char ftty[20 + sizeof ubuf->ut_line]; + char ttyFound[sizeof ubuf->ut_line] =3D ""; + char dispFound[sizeof ubuf->ut_line + 1] =3D ""; + + setutxent(); #define SCMPN(a, b) strncmp(a, b, sizeof (a)) status =3D NOT_HERE; (void) strcpy(ftty, _PATH_DEV); - while (fread((char *) &ubuf, sizeof ubuf, 1, fd) =3D=3D 1) { - if (!SCMPN(ubuf.ut_name, name)) { + while ((ubuf =3D getutxent())) { + if ((ubuf->ut_type =3D=3D USER_PROCESS) && + (!SCMPN(ubuf->ut_user, name))) { if (*tty =3D=3D '\0') { /* no particular tty was requested */ - (void) strcpy(ftty+5, ubuf.ut_line); + (void) strcpy(ftty+5, ubuf->ut_line); if (stat(ftty,&statb) =3D=3D 0) { if (!(statb.st_mode & 020)) /* ?character device? */ continue; - (void) strcpy(ttyFound, ubuf.ut_line); + (void) strcpy(ttyFound, ubuf->ut_line); #ifdef USE_UT_HOST - (void) strcpy(dispFound, ubuf.ut_host); + (void) strcpy(dispFound, ubuf->ut_host); strcat(dispFound, " "); #endif status =3D SUCCESS; @@ -384,13 +383,13 @@ } } } - else if (!strcmp(ubuf.ut_line, tty)) { + else if (!strcmp(ubuf->ut_line, tty)) { status =3D SUCCESS; break; } } } - fclose(fd); + endutxent(); if (status =3D=3D SUCCESS) { (void) strcpy(tty, ttyFound); (void) strcpy(disp, dispFound); --jtEtYGE75hrP1CgP-- --AJd+a2ML6L6CXP6l Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkzQZ2IACgkQ52SDGA2eCwUK8wCdHtPLPSE84t/Lzr2UeoA53Gql q8oAnj6bxSSoKy3QoN1/DF9A6v1FApse =a1NZ -----END PGP SIGNATURE----- --AJd+a2ML6L6CXP6l--