lib/common.c
branchstable-1.5
changeset 2703 045624f7f4c3
parent 2433 3bdd7a747fae
equal deleted inserted replaced
2702:c67a3647891d 2703:045624f7f4c3
    85     master->process_data_size = 0;
    85     master->process_data_size = 0;
    86     master->first_domain = NULL;
    86     master->first_domain = NULL;
    87     master->first_config = NULL;
    87     master->first_config = NULL;
    88 
    88 
    89     snprintf(path, MAX_PATH_LEN - 1,
    89     snprintf(path, MAX_PATH_LEN - 1,
    90 #ifdef USE_RTDM
       
    91             "EtherCAT%u",
       
    92 #else
       
    93             "/dev/EtherCAT%u",
    90             "/dev/EtherCAT%u",
    94 #endif
       
    95             master_index);
    91             master_index);
    96 
    92 
    97 #ifdef USE_RTDM
       
    98     master->fd = rt_dev_open(path, O_RDWR);
       
    99 #else
       
   100     master->fd = open(path, O_RDWR);
    93     master->fd = open(path, O_RDWR);
   101 #endif
       
   102     if (EC_IOCTL_IS_ERROR(master->fd)) {
    94     if (EC_IOCTL_IS_ERROR(master->fd)) {
   103         fprintf(stderr, "Failed to open %s: %s\n", path,
    95         fprintf(stderr, "Failed to open %s: %s\n", path,
   104                 strerror(EC_IOCTL_ERRNO(master->fd)));
    96                 strerror(EC_IOCTL_ERRNO(master->fd)));
   105         goto out_clear;
    97         goto out_clear;
   106     }
    98     }