- const char *value;
- int fd, newfd, flags, ret;
- char *end;
- errno = 0;
-
- value = (const char*)getenv(env);
- if (!value)
- return -1;
-
- const long int sl = strtol(value, &end, 10);
- if (end == value) {
- TDM_ERR("%s: not a decimal number\n", value);
- return -1;
- } else if (*end != '\0') {
- TDM_ERR("%s: extra characters at end of input: %s\n", value, end);
- return -1;
- } else if ((sl == LONG_MIN || sl == LONG_MAX) && errno == ERANGE) {
- TDM_ERR("%s out of range of type long\n", value);
- return -1;
- } else if (sl >= INT_MAX) {
- TDM_ERR("%ld greater than INT_MAX\n", sl);
- return -1;
- } else if (sl <= INT_MIN) {
- TDM_ERR("%ld less than INT_MIN\n", sl);
- return -1;
- } else {
- fd = (int)sl;
- if (fd < 0) {
- TDM_ERR("%d out of fd range\n", fd);
- return -1;
- }
- }
-
- flags = fcntl(fd, F_GETFD);
- if (flags == -1) {
- TDM_ERR("fcntl failed: %m");
+ if (strncmp(env, "TBM_DRM_MASTER_FD", 17) && strncmp(env, "TDM_DRM_MASTER_FD", 17)) {
+ TDM_INFO("DEPRECATED! '%s'", env);