public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Tomas Pihl <tomas.pihl@netinsight.net>
To: cygwin@sourceware.cygnus.com
Subject: Multiple fopens fails with permission denied
Date: Thu, 16 Mar 2000 02:31:00 -0000	[thread overview]
Message-ID: <38D0B7F5.7D4529DB@netinsight.net> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

I've installed B20.1 (full.exe) on a NT4.0 SP6 machine. When I try
running the below included program I get:

bash-2.02$ ./a.exe
Couldn't open '/dev/com1' for input
open: Permission denied

It doesn't matter in which order I make the calls - fopen() always fail
on the second fopen. Any ideas?

int main()
{
   FILE *fdin;
   FILE *fdout;
   char* device = "/dev/com1";

   if ((fdout = fopen(device, "wb")) == NULL) {
      printf("Couldn't open '%s' for output\n", device);
      perror("open");
      exit(1);
   }
   if ((fdin = fopen(device, "rb")) == NULL) {
      printf("Couldn't open '%s' for input\n", device);
      perror("open");
      exit(1);
   }
}

-- 
Tomas Pihl                    Net Insight AB
tomas.pihl@netinsight.net     Box 42093, SE-126 14 STOCKHOLM, SWEDEN
Phone:  +46-8-685 04 95       Visiting address: Västberga Allé 9
Fax:    +46-8-685 04 20       http://www.netinsight.net

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

             reply	other threads:[~2000-03-16  2:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-16  2:31 Tomas Pihl [this message]
2000-03-16  8:45 ` Chris Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38D0B7F5.7D4529DB@netinsight.net \
    --to=tomas.pihl@netinsight.net \
    --cc=cygwin@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).