From: Marcin Dawidowicz <marcin.dawidowicz@kontron.pl>
To: linuxppc-dev@ozlabs.org
Cc: "Garcia Jérémie" <GARCIAJ@3il.fr>
Subject: Re: Error while opennig device file
Date: Thu, 16 Jun 2005 11:23:41 +0200 [thread overview]
Message-ID: <200506161123.42050.marcin.dawidowicz@kontron.pl> (raw)
In-Reply-To: <D4FDDD1349B5AC46B68FC26AD8AF42D6226B38@exnet.3il.fr>
On Thursday 16 of June 2005 10:35, Garcia J=E9r=E9mie wrote:
> static int test_open(struct inode *inode , struct file *file)
> {
> int ret_val =3D 0;
>
> if (Device_open !=3D 0) <------
> return -EBUSY; <------
>
> Device_open++; <------
> printk("%d minor number!\n",MINOR(inode->i_rdev));
> MOD_INC_USE_COUNT;
>
> return ret_val;
> }
>
> Very traditionnal...
>
Have a look on marked lines.
> What error do you get on second open?
> --> I trace the execution of my programm and get the following :
> First opened succeeded, open() return code : 3 =A0 =A0
> Can't open second file, open() return code : -1 , errno =3D 16
>
> Looking in the errno.h, we have :
> #define=A0EBUSY=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A016=A0=A0=A0=A0=A0=A0/* De=
vice or resource busy */
This is what I would expect. You can remove marked lines and try again...
Regards,
Marcin
next prev parent reply other threads:[~2005-06-16 9:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-16 8:35 RE : RE : Error while opennig device file Garcia Jérémie
2005-06-16 9:23 ` Marcin Dawidowicz [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-06-15 16:19 Garcia Jérémie
2005-06-15 17:26 ` Eugene Surovegin
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=200506161123.42050.marcin.dawidowicz@kontron.pl \
--to=marcin.dawidowicz@kontron.pl \
--cc=GARCIAJ@3il.fr \
--cc=linuxppc-dev@ozlabs.org \
/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