Skip to content

Commit 5911036

Browse files
committed
Deduplicate errno values in errno2name()
On Darwin, the EQFULL and ELAST error constants lead to the same errno value (106), so we get a build error like this: src/errno_list.cc:228:14: error: duplicate case value '106' case 106: return "EQFULL"; ^ src/errno_list.cc:227:14: note: previous case defined here case 106: return "ELAST"; ^ We can simply throw away the duplicate values, because all that errno2name is used for is printing the current rules with the -p command line argument. Signed-off-by: aszlig <aszlig@nix.build>
1 parent fb7b4d9 commit 5911036

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/generrno.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
out += 'const std::string errno2name(int num)\n{\n'
3535
out += ' switch (num) {\n'
36-
for number, name in errnos:
36+
for number, name in dict(errnos).items():
3737
out += ' case ' + str(number) + ': return "' + name + '";\n'
3838
out += ' default: return "<unknown>";\n'
3939
out += ' }\n'

0 commit comments

Comments
 (0)