GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
shutdown.c
Go to the documentation of this file.
1
15
#include <stdlib.h>
16
17
#include <grass/dbmi.h>
18
#include <grass/spawn.h>
19
#include "
macros.h
"
20
36
int
db_shutdown_driver
(dbDriver *
driver
)
37
{
38
int
status;
39
40
#ifdef __MINGW32__
41
db__set_protocol_fds
(driver->send, driver->recv);
42
DB_START_PROCEDURE_CALL
(DB_PROC_SHUTDOWN_DRIVER);
43
#endif
44
45
/* close the communication FILEs */
46
fclose(driver->send);
47
fclose(driver->recv);
48
49
driver->send =
NULL
;
50
driver->recv =
NULL
;
51
52
/* wait for the driver to finish */
53
status = -1;
54
55
/* convert status according to return code of G_wait() */
56
status =
G_wait
(driver->pid) == -1 ? -1 : 0;
57
58
driver->pid = 0;
59
60
/* free the driver structure. THIS IS GOOFY */
61
db_free
(driver);
62
63
return
status;
64
}
lib
db
dbmi_client
shutdown.c
Generated on Sun Mar 16 2014 05:07:48 for GRASS Programmer's Manual by
1.8.1.2