Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions indigo_drivers/agent_astrometry/indigo_agent_astrometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static bool execute_command(indigo_device *device, char *command, ...) {
close(pipe_stdout[0]);
dup2(pipe_stdout[1], STDOUT_FILENO);
close(pipe_stdout[1]);
execl("/bin/sh", "sh", "-c", buffer, NULL, environ);
perror("execl");
execle("/bin/sh", "sh", "-c", buffer, NULL, environ);
perror("execle");
_exit(127);
}
}
Expand Down
2 changes: 1 addition & 1 deletion indigo_drivers/ccd_fli/indigo_ccd_fli.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static bool fli_read_pixels(indigo_device *device) {
if (timeleft) {
indigo_usleep((useconds_t)timeleft);
}
} while (timeleft*1000);
} while ((timeleft*1000) != 0);

do {
pthread_mutex_lock(&PRIVATE_DATA->usb_mutex);
Expand Down
2 changes: 1 addition & 1 deletion indigo_drivers/ccd_pentax/indigo_ccd_pentax.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static const char *to_hex(uint8_t *bytes, uint32_t count) {
}

static uint8_t scsi_command(indigo_device *device, uint8_t *cdb, int cdb_len, uint8_t flags, uint8_t *data, uint32_t data_length) {
command_block_wrapper cbw = { { 'U', 'S', 'B', 'C' }, PRIVATE_DATA->tag++, data_length, flags, PRIVATE_DATA->lun, cdb_len, 0 };
command_block_wrapper cbw = { { 'U', 'S', 'B', 'C' }, PRIVATE_DATA->tag++, data_length, flags, PRIVATE_DATA->lun, cdb_len, {0} };
command_status_wrapper csw;
int size = 0;
memcpy(cbw.CBWCB, cdb, cdb_len);
Expand Down
3 changes: 2 additions & 1 deletion indigo_drivers/mount_ioptron/indigo_mount_ioptron.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <inttypes.h>

#include <indigo/indigo_driver_xml.h>
#include <indigo/indigo_io.h>
Expand Down Expand Up @@ -386,7 +387,7 @@ static bool ieq_set_utc(indigo_device *device, time_t *secs, int utc_offset) {
}
}
} else if (PRIVATE_DATA->protocol == 0x0300) {
sprintf(command, ":SUT%013llu#", (uint64_t)((JDNOW - JD2000) * 8.64e+7));
sprintf(command, ":SUT%013" PRIu64 "#", (uint64_t)((JDNOW - JD2000) * 8.64e+7));
if (!ieq_command(device, command, response, 1) || *response != '1') {
MOUNT_SET_HOST_TIME_PROPERTY->state = INDIGO_ALERT_STATE;
} else {
Expand Down
8 changes: 5 additions & 3 deletions indigo_libs/indigo/indigo_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ typedef struct {
bool initialized; ///< driver is initialized
} indigo_driver_entry;

#define INDIGO_LAST_ERROR_SIZE 256

/** Remote executable entry type.
*/
typedef struct {
Expand All @@ -74,7 +76,7 @@ typedef struct {
bool thread_started; ///< client thread started/stopped
int pid; ///< process pid
indigo_device *protocol_adapter; ///< server protocol adapter
char last_error[256]; ///< last error reported within client thread
char last_error[INDIGO_LAST_ERROR_SIZE]; ///< last error reported within client thread
} indigo_subprocess_entry;

/** Array of all available drivers (statically & dynamically linked).
Expand Down Expand Up @@ -123,7 +125,7 @@ typedef struct {
bool thread_started; ///< client thread started/stopped
int socket; ///< stream socket
indigo_device *protocol_adapter; ///< server protocol adapter
char last_error[256]; ///< last error reported within client thread
char last_error[INDIGO_LAST_ERROR_SIZE]; ///< last error reported within client thread
bool shutdown; ///< request shutdown
} indigo_server_entry;

Expand All @@ -142,7 +144,7 @@ extern indigo_result indigo_connect_server(const char *name, const char *host, i
extern indigo_result indigo_connect_server_id(const char *name, const char *host, int port, uint32_t connection_id, indigo_server_entry **server);

/** If connected to the server returns true else returns false and last_error (if not NULL) will contain the last error
reported within client thread. Last_error should have length of 256.
reported within client thread. Last_error should have length of INDIGO_LAST_ERROR_SIZE.
*/
extern bool indigo_connection_status(indigo_server_entry *server, char *last_error);

Expand Down
4 changes: 2 additions & 2 deletions indigo_libs/indigo_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ static void *server_thread(indigo_server_entry *server) {
hints.ai_family = AF_INET;
if ((result = getaddrinfo(server->host, NULL, &hints, &address))) {
INDIGO_LOG(indigo_log("Can't resolve host name %s (%s)", server->host, gai_strerror(result)));
strncpy(server->last_error, gai_strerror(result), sizeof(server->last_error));
strncpy(server->last_error, gai_strerror(result), INDIGO_LAST_ERROR_SIZE);
} else if ((server->socket = socket(address->ai_family, SOCK_STREAM, 0)) < 0) {
INDIGO_LOG(indigo_log("Can't create socket (%s)", strerror(errno)));
strncpy(server->last_error, strerror(errno), sizeof(server->last_error));
strncpy(server->last_error, strerror(errno), INDIGO_LAST_ERROR_SIZE);
} else {
((struct sockaddr_in *)address->ai_addr)->sin_port = htons(server->port);
result = connect(server->socket, address->ai_addr, address->ai_addrlen);
Expand Down