Skip to content

Commit

Permalink
die nicely if opendir fails in example ls.pir
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Aug 17, 2011
1 parent 7a9e7ad commit 91518de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/nci/ls.pir
Expand Up @@ -34,6 +34,16 @@ In this encarnation it works on linux i386 and amd64 systems.

.local pmc curdir
curdir = opendir(dirname_c)
unless null curdir goto opened

.local pmc err
getstderr err
print err, "Cannot open directory '"
print err, dirname
print err, "'\n"
exit 1

opened:
.local pmc entry

.include "datatypes.pasm"
Expand Down

0 comments on commit 91518de

Please sign in to comment.