fpurge stopped working on Arch at some point

This commit is contained in:
Steven Dee 2014-03-25 15:41:09 +00:00 committed by Steve Dee
parent d9a27c0949
commit 5c68bb4de6
2 changed files with 13 additions and 2 deletions

View File

@ -151,6 +151,17 @@
# error "port: sync" # error "port: sync"
# endif # endif
/* Purge
*/
# if defined(U2_OS_linux)
# include <stdio_ext.h>
# define c3_fpurge __fpurge
# elif defined(U2_OS_bsd) || defined(U2_OS_osx)
# define c3_fpurge fpurge
# else
# error "port: fpurge"
# endif
/* Stat struct /* Stat struct
*/ */
# if defined(U2_OS_linux) # if defined(U2_OS_linux)

View File

@ -314,7 +314,7 @@ _sist_cask(u2_reck* rec_u, c3_c* dir_c, u2_bean nun)
printf("passcode for %s%s? ~", dir_c, (u2_yes == nun) ? " [none]" : ""); printf("passcode for %s%s? ~", dir_c, (u2_yes == nun) ? " [none]" : "");
paw_c[0] = 0; paw_c[0] = 0;
fpurge(stdin); c3_fpurge(stdin);
fgets(paw_c, 59, stdin); fgets(paw_c, 59, stdin);
if ( '\n' == paw_c[0] ) { if ( '\n' == paw_c[0] ) {
@ -399,7 +399,7 @@ _sist_bask(c3_c* pop_c, u2_bean may)
printf("%s [y/n]? ", pop_c); printf("%s [y/n]? ", pop_c);
ans_c[0] = 0; ans_c[0] = 0;
fpurge(stdin); c3_fpurge(stdin);
fgets(ans_c, 2, stdin); fgets(ans_c, 2, stdin);
if ( (ans_c[0] != 'y') && (ans_c[0] != 'n') ) { if ( (ans_c[0] != 'y') && (ans_c[0] != 'n') ) {