Skip to content

Commit

Permalink
use open/close instead of px4_open/px4_close for parameter file
Browse files Browse the repository at this point in the history
  • Loading branch information
tumbili committed Jun 1, 2015
1 parent 7cde535 commit f4a2509
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/systemcmds/param/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ static int
do_save(const char *param_file_name)
{
/* create the file */
int fd = px4_open(param_file_name, O_WRONLY | O_CREAT, 0x777);
int fd = open(param_file_name, O_WRONLY | O_CREAT, 0x777);

if (fd < 0) {
warn("opening '%s' failed", param_file_name);
return 1;
}

int result = param_export(fd, false);
px4_close(fd);
close(fd);

if (result < 0) {
(void)unlink(param_file_name);
Expand All @@ -224,15 +224,15 @@ do_save(const char *param_file_name)
static int
do_load(const char *param_file_name)
{
int fd = px4_open(param_file_name, O_RDONLY);
int fd = open(param_file_name, O_RDONLY);

if (fd < 0) {
warn("open '%s'", param_file_name);
return 1;
}

int result = param_load(fd);
px4_close(fd);
close(fd);

if (result < 0) {
warnx("error importing from '%s'", param_file_name);
Expand All @@ -245,15 +245,15 @@ do_load(const char *param_file_name)
static int
do_import(const char *param_file_name)
{
int fd = px4_open(param_file_name, O_RDONLY);
int fd = open(param_file_name, O_RDONLY);

if (fd < 0) {
warn("open '%s'", param_file_name);
return 1;
}

int result = param_import(fd);
px4_close(fd);
close(fd);

if (result < 0) {
warnx("error importing from '%s'", param_file_name);
Expand Down

0 comments on commit f4a2509

Please sign in to comment.