git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: duplicate htons() in check_file_directory_conflict()

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 7, 2005, 01:59 UTC
Message-ID
<Pine.LNX.4.58.0506061858140.1876@ppc970.osdl.org>
In-Reply-To
<1118098966l.5384l.0l@garlic>
On Mon, 6 Jun 2005, Timo Hirvonen wrote:
Show 5 quoted lines
>
> create_ce_flags() macro calls htons() so the htons()s in  
> check_file_directory_conflict() should be removed or alternatively htons  
> should be removed from the create_ce_flags macro. I noticed the bug when  
> compiling cogito with -Wshadow.
No, but it probably should be a ntohs()..

cache_name_pos() takes a host-order thing, and create_ce_flags creates a network order thing. It so happens that on all sane setups, ntohs == htons, so..

		Linus
Previous: Timo HirvonenNext: Timo Hirvonen
Message 2 of 3 in “duplicate htons() in check_file_directory_conflict()”
  1. Timo HirvonenJun 6, 2005
  2. Linus TorvaldsJun 7, 2005
  3. Use ntohs instead of htons to convert ce_flags to host byte orderTimo Hirvonen, Jun 7, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.