public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: return better inode numbers for block device entries in /proc/sys Date: Thu, 19 Aug 2021 14:12:44 +0000 (GMT) [thread overview] Message-ID: <20210819141244.8F0A23857817@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ad35bfbb0f527c6217b7cd6070d62785fb7f0025 commit ad35bfbb0f527c6217b7cd6070d62785fb7f0025 Author: Corinna Vinschen <corinna@vinschen.de> Date: Thu Aug 19 16:08:34 2021 +0200 Cygwin: return better inode numbers for block device entries in /proc/sys Commit 3434d35a64736f0b77a12f61784c2caa33ac44cf fixed a problem when accessing block devices via their /proc/sys/Device entries. This changed the way stat info is generated for these devices, resulting in identical inode numbers for all block devices under /proc/sys/Device. This patch fixes that by faking a device number for these devices, just as before. Fixes: 3434d35a6473 ("Cygwin: Fix access to block devices below /proc/sys.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Diff: --- winsup/cygwin/fhandler_raw.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc index 7c341d895..8d3314465 100644 --- a/winsup/cygwin/fhandler_raw.cc +++ b/winsup/cygwin/fhandler_raw.cc @@ -45,6 +45,8 @@ fhandler_dev_raw::fstat (struct stat *buf) else buf->st_mode = S_IFBLK | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH; + if (get_major () == DEV_SD_HIGHPART_END && get_minor () == 9999) + buf->st_ino = get_ino (); buf->st_uid = geteuid32 (); buf->st_gid = getegid32 (); buf->st_nlink = 1;
reply other threads:[~2021-08-19 14:12 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210819141244.8F0A23857817@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.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: linkBe 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).