Index: usr.bin/sed/main.c =================================================================== --- usr.bin/sed/main.c +++ usr.bin/sed/main.c @@ -242,8 +242,7 @@ switch (script->type) { case CU_FILE: if (strcmp(script->s, "-") == 0) { - if ((f = fdopen(0, "r")) == NULL) - err(1, "%s", "stdin"); + f = stdin; fname = "stdin"; } else { if ((f = fopen(script->s, "r")) == NULL)