🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #12280

Re: drawing to the root window (hack hack)

#12280
From: Rick Genter x18
Date: Wed, 26 Apr 1989 03:46
23 lines
1342 bytes
> As a digression, I should mention that there is approximately a 25%
> failure chance for a program whose first two executable lines are:

>   root_fd = open("/dev/win0");
>   root_pixwin = pw_open(root_fd);


If these are the two lines verbatim, then no kidding it fails at random.
open(2) takes 2 or 3 arguments, but never 1.  You want to do:

	root_fd = open("/dev/win0",O_RDONLY);

as it is, you're passing garbage as your second argument.  The third
argument is only used for O_CREAT.  By the way, O_* are defined in
<sys/file.h>.  (Actually in <sys/fcntlcom.h>, but that's included by
<sys/file.h> [SunOS 4.0*].)

If you're going to hack, at least use lint(1).
					- reg
--
Rick Genter					...!{buita,bbn}!lti!reg
Language Technology, Inc.			reg%lti.uucp@bu-it.bu.edu
27 Congress St., Salem, MA 01970		(508) 741-1507
Technical Details
Message-ID: <8903311702.AA03117@lti.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: reg@lti.com (Rick Genter x18)
Newsgroups: comp.sys.sun
Subject: Re: drawing to the root window (hack hack)
Keywords: Windows
Message-ID: <8903311702.AA03117@lti.com>
Date: 26 Apr 89 03:46:40 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 23
Approved: Sun-Spots@rice.edu
Original-Date: Fri, 31 Mar 89 12:02:05 EST
X-Sun-Spots-Digest: Volume 7, Issue 251, message 2 of 14