mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Rearrange code and make a faster sha256sum program
This commit is contained in:
parent
5e60e5ad10
commit
89d1e5b8f2
32 changed files with 933 additions and 517 deletions
|
@ -16,16 +16,17 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/errno.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if stream is in error state.
|
||||
*
|
||||
* @param f is file stream pointer
|
||||
* @return non-zero if and only if it's an error state
|
||||
* @return non-zero w/ errno only if `f` is in error state
|
||||
* @note EOF doesn't count
|
||||
* @see ferror(), feof()
|
||||
*/
|
||||
errno_t ferror_unlocked(FILE *f) {
|
||||
return f->state > 0 ? f->state : 0;
|
||||
return f->state > 0 ? (errno = f->state) : 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue