}
DPRINTF("Bundle has been copied successfully");
+ last_error_buffer_initialize();
+
if (link_bundle() == -1) {
EPRINTF("Cannot link profile bundle!");
result = -1;
break;
}
if (has_last_error() == -1) {
+ EPRINTF("last_error_buffer != NULL");
result = -1;
}
static struct errno_struct *last_error = NULL;
+void last_error_buffer_initialize(void)
+{
+ last_error = NULL;
+}
+
static int create_errno_buffer(void)
{
struct errno_struct *error = NULL;
{
unsigned int size;
- if (last_error == NULL)
- {
+ if (last_error == NULL) {
if (create_errno_buffer() != 0)
return -1;
}
size = strlen(buffer);
- if (last_error->size + size + 1 >= get_max_error_buffer_size()) {
+ if (last_error->size + size + 2 >= get_max_error_buffer_size()) {
return -1;
}
static void delete_errno_buffer(void)
{
- if (last_error == NULL)
+ if (last_error == NULL) {
return;
+ }
vfree((char*)last_error->buffer);
vfree(last_error);
{
int result;
- if (last_error == NULL)
+ if (last_error == NULL) {
return -1;
+ }
result = copy_to_user ((void*)u_addr, (void*)(last_error->buffer), last_error->size + 1);
if (result) {
int has_last_error()
{
- if(last_error == NULL)
+ if(last_error == NULL) {
return 0;
+ }
return -1;
}
int get_last_error(void* u_addr);
int has_last_error(void);
int update_errno_buffer(const char *buffer);
+void last_error_buffer_initialize(void);
extern int update_errno_buffer(const char *buffer);
extern int get_last_error(void* u_addr);
extern int has_last_error(void);
+extern void last_error_buffer_initialize(void);
///////////////////////////////////////////////////////////////////////////////////////////////////
extern int EnableContinuousRetrieval(void);