return is_support;
}
-#define INFOBUF_MAXLEN 64
-typedef struct platform_info {
- char platform_info_version[INFOBUF_MAXLEN];
- char model_name[INFOBUF_MAXLEN]; // Emulator
- char platform_name[INFOBUF_MAXLEN]; // Tizen
- char platform_version[INFOBUF_MAXLEN]; // 2.2.1
- char profile_name[INFOBUF_MAXLEN]; // 2.2.1
-} pinfo;
-
static int is_support_whitespace_pkgname(void){
int is_support = 0;
- struct platform_info pinfo;
-
- const char* GET_SYSTEM_INFO_CMD = "sysinfo:";
- int fd = sdb_connect(GET_SYSTEM_INFO_CMD);
+ int version = 0;
+ int major = 0;
+ int minor = 0;
+ int patch = 0;
- if(fd < 0) {
+ version = get_platform_version();
+ if(!version) {
// default : not support whitespace for package file name.
return 0;
}
- if (readx(fd, &pinfo, sizeof(struct platform_info)) == 0) {
- int major = 0;
- int minor = 0;
- int patch = 0;
- if (sscanf(pinfo.platform_version, "%d.%d.%d", &major, &minor, &patch) == 3) {
- // version number at least 2.4.0
- if (major >= 3 || (major >= 2 && minor >=4)) {
- is_support = 1;
- }
- }
+ major = MK_PLATFORM_MAJOR(version);
+ minor = MK_PLATFORM_MINOR(version);
+ patch = MK_PLATFORM_PATCH(version);
+
+ D("Platform version : %d.%d.%d\n", major, minor, patch);
+ // version number at least 2.4.0
+ if (major >= 3 || (major >= 2 && minor >=4)) {
+ is_support = 1;
}
- sdb_close(fd);
return is_support;
}
static int enable_sync_winsz = 0;
static void sync_winsz(void);
+#define INFOBUF_MAXLEN 64
+typedef struct platform_info {
+ char platform_info_version[INFOBUF_MAXLEN];
+ char model_name[INFOBUF_MAXLEN]; // Emulator
+ char platform_name[INFOBUF_MAXLEN]; // Tizen
+ char platform_version[INFOBUF_MAXLEN]; // 2.2.1
+ char profile_name[INFOBUF_MAXLEN]; // 2.2.1
+} pinfo;
+
+int get_platform_version(void) {
+ struct platform_info pinfo;
+
+ const char* GET_SYSTEM_INFO_CMD = "sysinfo:";
+ int fd = sdb_connect(GET_SYSTEM_INFO_CMD);
+ int version = 0;
+
+ if(fd < 0) {
+ return 0;
+ }
+
+ if (readx(fd, &pinfo, sizeof(struct platform_info)) == 0) {
+ int major = 0;
+ int minor = 0;
+ int patch = 0;
+ if (sscanf(pinfo.platform_version, "%d.%d.%d", &major, &minor, &patch) == 3) {
+ if (major < 1024 && minor < 1024 && patch < 1024) {
+ version |= (major << 20);
+ version |= (minor << 10);
+ version |= patch;
+ } else {
+ LOG_ERROR("Unexpected version : %d.%d.%d\n", major, minor, patch);
+ }
+ }
+ }
+ D("Platform version : %s(%x)\n", pinfo.platform_version, version);
+
+ sdb_close(fd);
+ return version;
+}
+
#ifdef HAVE_TERMIO_H
static __inline__ void stdin_raw_init(int fd, struct termios* tio_save);
char eshell[32] = "eshell:";
int lines, columns;
int fd = -1;
-
- if(get_screensize(&lines, &columns) == 0) {
- snprintf(eshell+7, sizeof(eshell)-7, "%d:%d", lines, columns);
- D("interactive shell : eshell command=%s\n", eshell);
- fd = sdb_connect(eshell);
- if(fd < 0) {
- fprintf(stdout, "failed environment shell, so it will retry shell command.\n");
+ int major = 0;
+ int minor = 0;
+ int patch = 0;
+ int version = 0;
+
+ version = get_platform_version();
+ major = MK_PLATFORM_MAJOR(version);
+ minor = MK_PLATFORM_MINOR(version);
+ patch = MK_PLATFORM_PATCH(version);
+
+ // eshell to support from the 2.4.0 version.
+ if (major >= 3 || (major >= 2 && minor >=4)) {
+ if(get_screensize(&lines, &columns) == 0) {
+ snprintf(eshell+7, sizeof(eshell)-7, "%d:%d", lines, columns);
+ D("interactive shell : eshell command=%s\n", eshell);
+ fd = sdb_connect(eshell);
+ if(fd < 0) {
+ fprintf(stdout, "failed environment shell, so it will retry shell command.\n");
+ return 1;
+ }
}
- }
- if(fd < 0) {
+ if(check_syncwinsz_support() == 1) {
+ D("Support sync window size with remote\n");
+ enable_sync_winsz = 1;
+ }
+ } else {
fd = sdb_connect("shell:");
if(fd < 0) {
return 1;
int* fd_p = malloc(sizeof(int));
*fd_p = fd;
ishell_fd = fd;
- if(check_syncwinsz_support() == 1) {
- D("Support sync window size with remote\n");
- enable_sync_winsz = 1;
- }
#ifdef HAVE_TERMIO_H
void** args = (void**)malloc(sizeof(void*)*2);