1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 10:04:33 +00:00

Add quit command

This commit is contained in:
Kano 2011-11-23 16:25:13 +11:00
parent 89c221ad8a
commit bbe1702d66
2 changed files with 13 additions and 3 deletions

12
api.c
View File

@ -189,6 +189,13 @@ char *poolstatus(char *params)
return buffer; return buffer;
} }
char *doquit(char *params)
{
bye = 1;
kill_work();
return NULL;
}
struct CMDS { struct CMDS {
char *name; char *name;
char *(*func)(char *); char *(*func)(char *);
@ -196,9 +203,10 @@ struct CMDS {
{ "apiversion", apiversion }, { "apiversion", apiversion },
{ "dev", devstatus }, { "dev", devstatus },
{ "pool", poolstatus }, { "pool", poolstatus },
{ "quit", doquit },
}; };
#define CMDMAX 3 #define CMDMAX 4
void send_result(int c, char *result) void send_result(int c, char *result)
{ {
@ -211,7 +219,7 @@ void send_result(int c, char *result)
n = write(c, result, strlen(result)+1); n = write(c, result, strlen(result)+1);
} }
void api() void api(void)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
const char *addr; const char *addr;

View File

@ -394,7 +394,9 @@ struct work_restart {
char padding[128 - sizeof(unsigned long)]; char padding[128 - sizeof(unsigned long)];
}; };
extern void api(); extern void kill_work(void);
extern void api(void);
#define MAX_GPUDEVICES 16 #define MAX_GPUDEVICES 16