The exit status (errorlevel) is 0 if PHost successfully performed the function you requested. When you specified -c, exit status 0 means everything is okay.

PHost returns exit status 1 when there is a permission problem with the game or root directory, or when you used -d or -t on a newly-mastered game.

PHost returns exit status -1 when it encountered a different error (like running out of memory, lacking a file), or when an internal consistency check failed (that is, you encountered a bug). Note that -1 is usually mapped to 255 by your operating system.

When PHost terminates because it received signal X, it exits with status -X. For example, the interrupt signal (Ctrl-C) has number 2 and causes PHost to exit with code -2 (mapped to 254 by the operating system).

When you are checking turn files (-c), a nonzero status means that something was wrong with the turn file.

ValueMeaning
1Turn file is missing
2Turn file is stale
4Turn file is truncated
8Turn file is damaged (unknown command)
16Turn file comes from wrong player
32Turn file checksum is incorrect
64Yellow alert
128Red alert

When you're checking several files at once (-c0), exit status is the bitwise OR of all matching values. For example, an exit code of 10 = 8+2 means that at least one turn was stale and one was damaged.

This is a testing version.
It may be incomplete, and have more bugs (or features) than the public live version at planetscentral.com.